Welcome Guest! You need to login or register to make posts.



Go to last post Go to first unread
#1 Posted : Thursday, October 7, 2004 12:49:00 AM(UTC)

Rank: Member

Groups: Member
Joined: 12/16/2003(UTC)
Posts: 13

Does Image Uploader v3 delete properly uploaded files from tmp dir ?

I'm using Linux/Apache/PHP/Image Uploader 3

I would like to be sure that this is done properly and that the tmp dir (I have no tmp dir defined in php.ini so I guess its Linux tmp dir /tmp) is cleaned.


#2 Posted : Friday, October 8, 2004 4:13:00 PM(UTC)

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Hello Paul,

Image Uploader does not (and should not) clean any files at server side. It is a client-side software which does not know anything about temporary files at server.

All the server temporary files cleanup should be done by PHP. According to the PHP documentation (highlighted with bold):

The PHP script which receives the uploaded file should implement whatever logic is necessary for determining what should be done with the uploaded file. You can, for example, use the $_FILES['userfile']['size'] variable to throw away any files that are either too small or too big. You could use the $_FILES['userfile']['type'] variable to throw away any files that didn't match a certain type criteria. As of PHP 4.2.0, you could use $_FILES['userfile']['error'] and plan your logic according to the error codes. Whatever the logic, you should either delete the file from the temporary directory or move it elsewhere.

If no file is selected for upload in your form, PHP will return $_FILES['userfile']['size'] as 0, and $_FILES['userfile']['tmp_name'] as none.

The file will be deleted from the temporary directory at the end of the request if it has not been moved away or renamed.

Hope this helps.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.