I have the following. A website that create temporarily images in the /tmp folder on the Linux server. The reason why I store it within this folder is since these images need to be cleared once in a while and it's so much easier just to clear the tmp directory using tmpwatch. Now my issue is to display the image within my browser?
<img src="/tmp/3d34636.png" alt="image" />
I'm running Centos with PHP
printing uid of a file on linux system
How to handle key pressed in a Linux console in C?
simulating atm communication without atm switch
This client does not have access to the filesystem of the HTTP server..
Can I run original MS.Net Framework 4 on Linux someway (with Wine perhaps)?
Therefore, you have either to define the /tmp directory to be a valid location of your HTTP server, using the files in /tmp/ directory (but note that it would serve any other file contained in this directory, potentialy a security risk)..
Garbage data from serial port
Or you store these generated images in a subdirectory that is already served by your HTTP server..
Why setupterm terminates the program?
It may also be possible to define this /tmp location on the server to be served by a script that would analyse the URL containing the image filename.
Python - detect keyboard layout
This script would then open the file in /tmp/ and serve it..
What can I do with Seed?
Even if you built a PHP script that accepts the file name as a parameter, and then passes through the file from the
/tmpdirectory, you would be mixing public content with temp files that can contain sensitive data.
You would have to keep a list of which files were generated by your script and are okay to display, and which ones are not, otherwise it would be a security hole.. I'd say forget
/tmpfor this despite the advantages, and store your images in a sub-directory of their own.
Delete them frequently (e.g.
using a cron job, or based on file age or the "last accessed" time)..
/usr/sbin/tmpwatch -umc 240 /path/to/directory
240is the number of hours that the files haven't been used for before deletion (in this case 10 days).
man tmpwatchfor full details..