Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 03/24/2012
Components: File Management
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: Public Beta / CF11 Update5,CF10 Update16
Priority/Frequency: Normal / Few users will encounter
Locale/System: English / Win All
Vote Count: 0
Since "filefield" is an optional parameter, an empty string should be ignored. Especially since "accept" is an optional parameter and ignores an empty string.
Repro:
<cfscript>
result={};
if(structCount(FORM)) {
result.one = fileUpload(expandPath('.'));
try{result.two = fileUpload(expandPath('.'), "", "", "overwrite");}//empty fileField should be ignored
catch(any e){result.two=e;}
}
</cfscript>
<cfform enctype="multipart/form-data">
<cfinput type="file" name="filedata" />
<cfinput type="submit" name="upload" />
</cfform>
<cfdump var="#result#" />
See an error is thrown. No error should be thrown.
Error: "FormFileNotFoundException - The form field '' did not contain a file."
The default "filefield" is the 1st file field in the submitted form (which, in the case of cffileupload, is the _only_ "file field" submitted). So, instead of throwing an exception here, it should reference the file field named "filedata" (since it is the 1st file field submitted).
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3148657
External Customer Info:
External Company:
External Customer Name: itisdesign
External Customer Email:
Attachments:
Comments: