Uploaded file using PHP scripts are getting deleted of it's

Hi,

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?

You're moving the files with moveuploadedfile(), right?

http://ca3.php.net/manual/en/function.m … d-file.php">http://ca3.php.net/manual/en/function.move-uploaded-file.php

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct