Help - Search - Members - Calendar
Full Version: temp files
Hostony Board > General Support > General Support
mishoboss
Hi, support,
where are stored the temp files? I upload files via php upload script and tmp_name shows me something like this: /tmp/phpGWCbq2. In my root directory I have a tmp folder. I click the "Submit" button in the upload script. In the same time I LIST via FTP client the files in that tmp folder and there is not such file (phpGWCbq2). So, I think that this is not the directory I need. Can you please tell me where are stored the temp files? And one more question - how are named the temp files? I see they all start with "php" and then somethink random. Is that right? And how can I access a tmp file with a random name?

Thanks in advance.
Lehrer
Mishoboss,
Your temp files are stored in the /tmp directory. They all really begin with php. or sess_
As for random tmp files, you don't really need to access them, user "nobody" can write here, otherwise most scripts wouldn't have worked at all.

Best wishes, Lehrer
mishoboss
Hi Lehrer,
thanks for the fast answer. That what I need is to check the file size during the file is uploading. The problem is that I can't access the tmp file, because I dont know the file name (php + random). Is there a solution for this?

Thanks again.
Niakie
PHP has a number of functions to access uploaded files. Below I've included a sample script to access uploaded files. You might want to have a look at is_uploaded_file documentation for other more complete examples.


CODE
foreach($HTTP_POST_FILES as $file_name => $file_array) {
 if (is_uploaded_file($file_array['tmp_name'])) {
   // copy/view/whatever file here
 }
}
mishoboss
Thanks, but this works only when the file is already uploaded. I need to check its file size during the uploading. I want to show in realtime uploading process. Something like this: You have uploaded 450 KB, 10 seconds later: You have uploaded 550 KB or something like this.

I created a Flash movie that calls every 5 seconds a php script that try to chek the filesize of the tmp file, that is uploading at the moment. But I dont know the temp file name, because its something random generated. Any idea or solution for this? Thanks again.
Niakie
This isn't possible useing PHP alone, but you could have a look at Site With The Lamp which has a work around combining PHP and perl. Hope this helps
mishoboss
huh, I know that script, but I couldn't run it on my server. sad.gif Is there an alternative availible? I searched in the NET but nothing. This was the only one I found.
Slavik
Could you tell me your main domain,please. biggrin.gif
mishoboss
www.m-designbg.com smile.gif

P.S. I have just run it!!! biggrin.gif I dont know what was wrong before. I uploaded the same files (nothing modified) again, and its work! smile.gif

Thanks to everybody!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here