Page 2 of 2

Posted: Sun Feb 29, 2004 7:10 pm
by mikegotnaild
I got a problem with that code.. Even if there isnt a file on my server with the same name as the files that i want to upload.. it still gives me that error message "echo "<b>The file $imagefile chose to upload has the same name as a file on our server. Please rename it.</b>";"

Posted: Sun Feb 29, 2004 7:11 pm
by phuts
I'm thinking you may want to just do hidden fields..

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">&nbsp <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>
i'd suggest putting something this in a separate file, then including it on the line just before your "exit()" function.

any opinions?

Posted: Sun Feb 29, 2004 7:17 pm
by mikegotnaild
I'll Try that. But do you have any thoughts on why im getting that error message even when i upload a file that doesnt exist on my server.

Posted: Sun Feb 29, 2004 7:23 pm
by mikegotnaild
"There is already a file called on our server. Please rename this file.

Click the Back button and RE-SUBMIT. "

Thats the message i get when i try to upload an image. There is no image with the same file name as the one i tried uploading either.. Notice that $imagefile didnt echo anything.

Posted: Sun Feb 29, 2004 7:24 pm
by phuts
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.

Posted: Sun Feb 29, 2004 7:25 pm
by mikegotnaild
Ok

Posted: Sun Feb 29, 2004 7:29 pm
by phuts
sorry mikegotnaild, I'm not exactly what you'd call an expert when it comes to things outside of my own site. Hopefully some php god will come along and help us figure this out.

Posted: Sun Feb 29, 2004 7:30 pm
by mikegotnaild
:) Well there are some very smart people here.

Posted: Sun Feb 29, 2004 7:34 pm
by phuts
mikegotnaild wrote::) Well there are some very smart people here.
i'd wait for one of them.. heh

Posted: Sun Feb 29, 2004 7:35 pm
by mikegotnaild
LoL thats what i spend the majority of my time doing on here.