Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cffile multiple upload problem

Status
Not open for further replies.

vanhalen

Programmer
Jan 11, 2002
2
0
0
US
I'm having trouble uploading multiple image files to my server, and here's my hangup. I have the following on my
1st page:

<cfform action=&quot;thanks-test.cfm&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;>
<input type=&quot;file&quot; size=&quot;25&quot; name=&quot;pic1&quot;><br>
<input type=&quot;file&quot; size=&quot;25&quot; name=&quot;pic2&quot;><br>
<input type=&quot;file&quot; size=&quot;25&quot; name=&quot;pic3&quot;><br>
<input type=&quot;file&quot; size=&quot;25&quot; name=&quot;pic4&quot;><br>
<input type=&quot;file&quot; size=&quot;25&quot; name=&quot;pic5&quot;>
<p>
<input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit&quot;>
</cfform>

Pretty basic, right? Well, this is my code on the following page for the 1st image (the other 4 images are the same):

<cfif #form.pic1# is not &quot;&quot;>
<cffile destination=&quot;PATH&quot; action=&quot;upload&quot; nameconflict=&quot;overwrite&quot; filefield=&quot;pic1&quot;>
</cfif>

Also basic. Say for example I upload 1 image and leave the other 4 blank. This works fine on every browser except for IE 5.1 on the Mac. Apparently, when the files are uploaded to the server, they are assigned a temporary name. Well, IE on the Mac is the only browser that thinks the temporary name is a file name. &quot;pic2&quot; therefore passes the validation and tries to upload a blank field even if nothing has been entered. Does this make sense?!?! What else can I do to make sure this works? Thanks.
 

Can you try to use Evaluate() function on the form fields?

Example:
<cfif Evaluate(&quot;Form.pic1&quot;) is &quot;&quot;>
<!--- do nothing --->
<cfelse>
do your uploading
</cfif>

You can do it in a loop, so that it's more need and tidy.

Good Luck.

sshhz

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top