tracker issue : CF-3043111

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

Bug 85895:(Watson Migration Closure)Content-Type is not set appropriately when writing to S3

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Henry Ho / Henry Ho (Henry Ho)

Created: 01/18/2011

Components: File Management, VFS-S3

Versions: 9.0.1

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 / CF11 Update5

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 1

Listed in the version 11.0.05.293506 Issues Fixed doc
Verification notes: verified_fixed on February 16, 2019 using build 2016.0.01.298513
Problem:

Content-Type is not set appropriately when writing to S3.  It is always "application/octet-stream", which might not work for some browser.
Method:

if we dont set the content type all file are uploaded to s3 with appplication/octect as   the content type. The below code works
<cfif isDefined("Form.FileContents") > 
    <!--- If TRUE, upload the file. ---> 
    <cffile action = "upload"  
        fileField = "FileContents"  
        destination = "s3://cfbugstest/taj.jpg" 
        accept= "image/jpeg"
        nameConflict = "MakeUnique">
		<cfset meta= storeGetMetadata("s3://cfbugstest/taj.jpg")>
<cfdump var="#meta#"> 
<cfelse> 
    <!--- If FALSE, show the Form. ---> 
    <form method="post" action=<cfoutput>#cgi.script_name#</cfoutput>  
        name="uploadForm" enctype="multipart/form-data"> 
        <input name="FileContents" type="file"> 
        <br> 
        <input name="submit" type="submit" value="Upload File">  
    </form> 
</cfif>

But if you set content type in accept of cffile the code will not work
<cfif isDefined("Form.FileContents") > 
    <!--- If TRUE, upload the file. ---> 
    <cffile action = "upload"  
        fileField = "FileContents"  
        destination = "s3://cfbugstest/taj.jpg"  
        nameConflict = "MakeUnique">
		<cfset meta= storeGetMetadata("s3://cfbugstest/taj.jpg")>
<cfdump var="#meta#"> 
<cfelse> 
    <!--- If FALSE, show the Form. ---> 
    <form method="post" action=<cfoutput>#cgi.script_name#</cfoutput>  
        name="uploadForm" enctype="multipart/form-data"> 
        <input name="FileContents" type="file"> 
        <br> 
        <input name="submit" type="submit" value="Upload File">  
    </form> 
</cfif>
Result:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3043111

External Customer Info:
External Company:  
External Customer Name: Henry Ho
External Customer Email: 237A22C24921EDF5992015B9
External Test Config: 01/18/2011

Attachments:

Comments:

Hi Adobe, I was unable to reproduce this issue (description: omitting "accept" attribute, during file upload, sets MIME type to "appplication/octect") in CF11 Update 7 (build 11.0.07.296330). Issue must've been fixed prior to CF11 Update 7, and, thus, shouldn't have been listed in CF2016 Final's Issues Fixed list. Thanks!, -Aaron
Comment by Aaron N.
30282 | February 16, 2019 08:29:19 AM GMT