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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFILE error saving empty file. 2

Status
Not open for further replies.

PTmon

IS-IT--Management
Mar 8, 2001
284
US
I have a form with 3 places for uploading files of different types. If I leave one empty I get the error:

Error processing CFFILE

No data was received in the uploaded file '\' Saving empty (zero-length) files is prohibitted. Please make sure you specified the correct file.

I thought this would work, but evidently not:

<cfif #Len(Trim(Form.pdf IS NOT 0))#><cffile action=&quot;UPLOAD&quot; filefield=&quot;pdf&quot; destination=&quot;d:\mydommain.com\media\&quot; nameconflict=&quot;MAKEUNIQUE&quot;></cfif>

If I have a file in all 3 slots, it works fine. If I only have 2 slots with files, they both upload and the 3rd gives me that error.
TIA,
PT


 
This is how I use it:

<cfif form.pdf NEQ &quot;&quot;>

Process upload code

</cfif>

DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
You're not coding the IF statement quite right, PT.

Try:
Code:
<cfif Len(Trim(Form.pdf)) IS NOT 0>

Your code tries to find the length of &quot;Form.pdf IS NOT 0&quot;... which would always be non-zero, or true.


-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top