GeekyCorner
02 Jul php upload and overwrite existing file Posted by vikram | 5 Comments
I want to know this thing when we upload the file on the server if there is another file already save with the same name and i want to replace that file with the new file can i do this. In short i want to replace the old file with the new file.

5 Replies to "php upload and overwrite existing file"

Sasho Valkanov July 2, 2007 at 12:38 pm | Reply

0

when you upload the file for first time make sure to change its permissions so it is writable. Next time you upload a file with the same name it will overwrite the existing one.
venkatesh August 30, 2013 at 1:41 pm

0

Sir,

I am working excel file upload and overwrite in php.But overwrite command not working.

So please provide solution upload overwrite code

Regards,
Venkatesh
edin February 21, 2011 at 2:35 am | Reply

0

Posted by Veselin Stoilov on Jul 2nd, 2007

when you upload the file for first time make sure to change its permissions so it is writable. Next time you upload a file with the same name it will overwrite the existing one.
______

So, every time when I want to upload "double" file on server, first should I go to root of server and change files permission??? Is that solution???
Sasho Valkanov February 24, 2011 at 9:48 pm | Reply

0

you can change file permissions using PHP after uploading the file.
venkateh August 30, 2013 at 1:44 pm | Reply

0

Thanks
  • 1


Please be polite and helpful and do not spam or offend others. We promise you will be treated the same way.

Log in your free account or if you still haven't joined you can create your free account now.

Posting tip:
if you use code in your comments please put it in these tags [php], [sql], [css], [js]
PHP code example: [php] echo date("Y-m-d"); [/php]

Thank you,
~ PHPJabbers team ~