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 Upload 1

Status
Not open for further replies.

jkwtek

Programmer
Sep 7, 2000
6
0
0
US
Visit site
I have a form where I am allowing the users to upload multiple files. If one of the fields are blank the form will not complete the upload and I get a CF Error. How can I correct this?

Ques2:
In my upload CFFILE attribute FILEFIELD is thier a way for me to make this global and have multiple fields use one CFFILE statement.

Currently my code looks like this and it is not efficient for reuse

If any of these fields are left blank on the form it bombs.

<CFFILE ACTION=&quot;UPLOAD&quot;
DESTINATION=&quot;C:\inetpub\NAMECONFLICT=&quot;OVERWRITE&quot;
FILEFIELD=&quot;Staff_Image&quot;>


<CFFILE ACTION=&quot;UPLOAD&quot;
DESTINATION=&quot;C:\inetpub\NAMECONFLICT=&quot;OVERWRITE&quot;
FILEFIELD=&quot;Audio&quot;>

<CFFILE ACTION=&quot;UPLOAD&quot;
DESTINATION=&quot;C:\inetpub\NAMECONFLICT=&quot;OVERWRITE&quot;
FILEFIELD=&quot;Text&quot;>

<CFFILE ACTION=&quot;UPLOAD&quot;
DESTINATION=&quot;C:\inetpub\NAMECONFLICT=&quot;OVERWRITE&quot;
FILEFIELD=&quot;Image_Emp&quot;> [sig]<p>Julius<br><a href=mailto:jweems@infotek-intl.com>jweems@infotek-intl.com</a><br>"Imagination is more important than Knowledge"[/sig]
 
Why dont you use a <CFIF> statement for each to check if it's empty and if it is you wont do the upload process?

<CFIF Staff_Image IS NOT &quot;&quot;>
[tab]<CFFILE ACTION=&quot;UPLOAD&quot;
[tab]DESTINATION=&quot;C:\inetpub\[tab]NAMECONFLICT=&quot;OVERWRITE&quot;
[tab]FILEFIELD=&quot;Staff_Image&quot;>
</CFIF>

For you Question 2: you cant upload multiple file with a CFFILE... You must do it the way you did or with a CFLOOP or something...

Chris [sig][/sig]
 
I'm trying to do the same thing, and it works on all browsers except for IE 5.1 on the Mac. I put in the conditional code as suggested, but the problem is when these files are uploaded tp my server they are assigned temporary names as they are being uploaded. IE on the Mac catches this, and thinks it is a file name. When it tries to pass, it gives an error on the &quot;cffile&quot; line. Is there any other conditional code I can use? Can you please help? Thanks!
-Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top