Re: Uploaded File OverWriting Old File
| From: | Nick Wilson | Date: | Sat, 11 May 2002 10:23:35 +0000 |
| Subject: | Re: Uploaded File OverWriting Old File | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-97079@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
* and then Thomas Edison Jr. declared....
> Hi,
>
> If i have a filename "room.jpg" in my Upload
> Directory, and someone else comes and uploads a file
> by the same name, the previous "room.jpg" is
> overwritten by the new one. Any suggestions?
Well, I presume that you would like for this *not* to happen right?
if so, just add a if(file_exist($img)) { change name of img.
I expect you could add an 1 to the end or better still, have the user
choose another name?
- --
Nick Wilson // www.explodingnet.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
iD8DBQE83PEnHpvrrTa6L5oRApJlAJ9n3/jsPvej8U1DwjDQnED7wwp4FQCgjjGh
SO2IqQydOwy9zA0Q7TCd9no=
=xxgQ
-----END PGP SIGNATURE-----