Page 1 of 1

how to replace the file from server folder

Posted: Mon Nov 06, 2006 3:56 am
by mang
In my project i m going to upload a resume in specified folder on server and the file name is going to be saved in database
A user can later update his information and can upload the another file.So i want to repalce the previous file with this new file from server folder and So how can i do that ! I m using A php code

Thanking you in advance !

Posted: Mon Nov 06, 2006 6:19 am
by feyd
I'm not sure why this is a security thread, but okay.

You're saving the filename in the database of the original. I'll presume that this filename is associated with the user, therefore you have the ability to find if they've uploaded a file before and what the filename is. You already know the location so it's a matter of maybe needing unlink(), but I don't remember absolutely needing it in many cases before calling move_uploaded_file().