tracker issue : CF-3148657

select a category, or use search below
(searches all categories and all time range)
Title:

fileUpload() not ignoring empty string for filefield

| View in Tracker

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

Listed in the version 11.0.05.293506 Issues Fixed doc
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:

The fix for this bug is available in the pre-release build of ColdFusion 11 Update 5 and ColdFusion 10 Update 16
Comment by CFwatson U.
19986 | February 20, 2015 09:24:58 AM GMT
Verified this is fixed in CF11 Update 5 (build 11,0,05,293506). Thanks!, -Aaron
Comment by External U.
19987 | November 17, 2015 02:41:56 AM GMT