Uploaded file using PHP scripts are getting deleted of it's
I'm having a very strange problem. I use lampp on centOS linux. My application has a upload Script (in PHP) which uploads file to file system. after upload and moving file to correct location, uploaded files are getting deleted. I check file upload and moving of file by putting all the status in a text log file. files are getting uploaded properly and after upload I'm able to move the files to it's correct location.
thanks,
Jitender Aryan
2 Replies
@jitender.ind:
after upload and moving file to correct location, uploaded files are getting deleted.
Which file is getting deleted?
(1) The file at the temporary location (before move)
(2) The file at the "correct" lcoation (after move)
If (1) is getting deleted, that's normal; that's what it means to "move" a file from one location to another. Even if you don't move it, the temporary file will be deleted at the end of the script.
If (2) is getting deleted, check your error logs to see if something is preventing the file from being saved properly. Is the location is writable by Apache? Is it subject to safemode or openbasedir restrictions?