Hey guys, I would just like to know something... like I know how to write a script that lets you upload files to the net... but how do you go about it if you want to update a file, meaning you have to overwrite it when you upload it again...
I'm still getting used to PHP so yeah... any help would be greatly appreciated.
Thanks,
Joshua
Overwriting an existing file when uploading...
Started by Bug, Aug 09 2006 07:03 AM
4 replies to this topic
#1
Posted 09 August 2006 - 07:03 AM
#2
Posted 09 August 2006 - 09:53 AM
One way is that you can delete it first.
if(file_exists( $yourFile ))
{
unlink( $yourFile );
}
move_uploaded_file( ... );
#3
Posted 09 August 2006 - 12:23 PM
I think it will automatically overwrite the file if you don't have checks for file_exists.
#5
Posted 26 August 2006 - 08:13 AM
Yeah, thanks... it worked great for me!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
