Title:
cffile/S3 : file is not uploaded in the correct destination directory under certain circumstances.
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): / ext-user (Piyush Kumar Nayak)
Created: 08/25/2016
Components: File Management, VFS-S3
Versions: 2016
Failure Type: Incorrect w/Workaround
Found In Build/Fixed In Build: 2016 b.300027 / 2016.0.04.302382
Priority/Frequency: Major / Few users will encounter
Locale/System: English / Windows 7 SP1 64-bit
Vote Count: 0
Problem:
cffile/S3 : file is not uploaded in the correct destination directory under certain circumstances.
This is a spillover from bug#3985340.
Method:
verified with 2016 b.300027 / Win 7x64
---------------- t.cfm ---------------------
<cfset _url = "http://" & CGI.HTTP_HOST & "/" & CGI.CONTEXT_PATH & "/" & getDirectoryFromPath(CGI.SCRIPT_NAME) & "_t.cfm">
<cfset destDir = "s3://#application.s3.bucket#/u2/">
<cfset filecopy("#expandpath("./")#agnt.txt", "#destDir#/agnt.txt")> <!--- creates the u2 folder --->
<cfset sleep(1000)>
<cfhttp method="Post" url="#_url#">
<cfhttpparam type="FILE"
name="#application.formfieldname#"
file="#GetDirectoryFromPath(GetCurrentTemplatePath())#dummy.txt" mimetype="text/plain">
</cfhttp>
<cfoutput>#cfhttp.filecontent#</cfoutput>
---------------- _t.cfm ---------------------
<cfset destDir = "s3://#application.s3.accessKeyId#:#application.s3.awsSecretKey#@#application.s3.bucket#/u2/">
<cffile action="UPLOADALL"
destination="#destDir#"
filefield="form.#application.formfieldname#"
accept="text/plain"
nameconflict = "overwrite">
<cfdirectory action="LIST" directory="#destDir#" name="fileList">
<cfloop query="fileList">
<cfoutput>#fileList.Directory#<tr>#fileList.name#</cfoutput><br>
</cfloop>
Result:
The code does not upload "dummy.txt" to the "u2" folder.
It creates another "u2" file parallel to the u2 folder.
Now delete agnt.txt from u2 dir and rerun t.cfm. dummy.txt is uploaded correctly in u2 dir.
Expected:
"dummy.txt" should be uploaded in u2 dir.
Workaround:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4184038
External Customer Info:
External Company:
External Customer Name:
External Customer Email:
Attachments:
Comments: