I have several file uploads from a form. While a user may upload some files, they are not required to fill in all of them. On the processing page for the file uploads I want to prevent a file upload if no file was specified on the first page. I tried implmenting a <CFIF "value" IS NOT ""> around my CFFILE upload on the processing page, however that did not work. Anyone have any ideas?
Page 1:
<td align="right"><b><font face="Tahoma, Arial" size="2">Attach photograph of Driver<br>
</font><font face="Tahoma, Arial" size="1">No more than
12 months old</font><font face="Tahoma, Arial" size="2"><br>
</font><font face="Tahoma, Arial" size="1">(click on 'Browse' to locate Photograph file)</font></b></td>
<td></td>
On the page that process the file upload I need to prvent a file upload if the user decides not to upload a file:
<CFIF "licensephoto" IS NOT "">
<CFFILE ACTION="Upload"
FILEFIELD="licensephoto"
DESTINATION="c:\web\upload\"
ACCEPT="image/jpg, image/pjpeg,image/gif,image/bmp, image/tiff"
NAMECONFLICT="OVERWRITE">
</cfif>
This did not work when I did not attach a file. I got an error. I got the following error message:
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
This leads me to the belief that the CFIF wrap around the file upload is not working. I need to prevent a file upload transaction if no file was specfied
Thanks ahead of time