Stop overwriting of user uploaded files if file name exists
Moderator: General Moderators
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm
I'm thinking you may want to just do hidden fields..
i'd suggest putting something this in a separate file, then including it on the line just before your "exit()" function.
any opinions?
Code: Select all
<html><FORM enctype="multipart/form-data" ACTION="http://naild.com/localmm/modules.php?name=Band_Submit&file=upload" METHOD="POST">
<input name="band_name" type="hidden" id="band_name" value="<?php echo $bandname;?>">
<input name="description" type="hidden" id="description" value="<?php echo $description;?>">
<input name="history" type="hidden" id="history" value="<?php echo $history;?>">
<input name="influences" type="hidden" id="influences" value="<?php echo $influences;?>">
<input name="genra" type="hidden" id="genra" value="<?php echo $genra;?>">
<input name="email" type="hidden" id="email" value="<?php echo $email;?>">
<input name="website" type="hidden" id="website" value="<?php echo $website;?>">
Upload files:<BR>
<i>Click Browse then browse to your file</i><br>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="200000" />
Image File: (200 kb max)<br>
<INPUT TYPE="FILE" NAME="imagefile" SIZE="50">  <i>(IF you do select an image file or mp3 file to upload, UPLOAD TIMES MAY VARY. The page will appear to be loading, but thats the upload in progress)</i><BR>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="6000000" />
Mp3/.avi/.mpg/.mpeg/.zip File: (6MB max)<br>
<INPUT TYPE="FILE" NAME="mp3file" SIZE="50"><BR>
<INPUT TYPE="submit" name="submit" value="submit"><BR>
</form></html>any opinions?
Last edited by phuts on Sun Feb 29, 2004 7:26 pm, edited 3 times in total.
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm
hmmm.. like I said, i'm not sure if that code with the if( file_exists... line is correct.. anyone?
oh and typo in my previous post. $SERVER['PHP_SELF'] should be $_SERVER['PHP_SELF'] also, if you do an include (as opposed to simply inserting the code into the original file) replace the "$_SERVER['PHP_SELF"]" with the address of the upload script.
oh and typo in my previous post. $SERVER['PHP_SELF'] should be $_SERVER['PHP_SELF'] also, if you do an include (as opposed to simply inserting the code into the original file) replace the "$_SERVER['PHP_SELF"]" with the address of the upload script.
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm
-
mikegotnaild
- Forum Contributor
- Posts: 173
- Joined: Sat Feb 14, 2004 5:59 pm