Title:
[ANeff] Bug for: S3 Content-Type always application/octet-stream on first write
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Aaron N. / ()
Created: 02/17/2019
Components: File Management, VFS-S3
Versions: 2016,2018
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: 2018.0.0.310739 / CF2016U12,CF2018U5
Priority/Frequency: Normal / Some users will encounter
Locale/System: / Windows 10 64 bit
Vote Count: 0
Issue: S3 Content-Type always application/octet-stream on first write
Repro:
<cfscript>
myS3Directory = "s3://mybucket";//replace with your bucket name
if(!directoryExists(myS3Directory)) {
directoryCreate(myS3Directory);
}
myImage = imageNew("", 200, 200, "rgb", "blue");
imageWrite(myImage, myS3Directory & '/myJPG.jpg', 1, true);
writeOutput(storeGetMetadata(myS3Directory & '/myJPG.jpg').content_type & '<br>');//application/octet-stream (bad)
fileCopy(myS3Directory & '/myJPG.jpg', myS3Directory & '/myJPGCopy.jpg');
writeOutput(storeGetMetadata(myS3Directory & '/myJPGCopy.jpg').content_type & '<br>');//image/jpeg (good)
imageWrite(myImage, myS3Directory & '/myPNG.png', 1, true);
writeOutput(storeGetMetadata(myS3Directory & '/myPNG.png').content_type & '<br>');//application/octet-stream (bad)
fileCopy(myS3Directory & '/myPNG.png', myS3Directory & '/myPNGCopy.png');
writeOutput(storeGetMetadata(myS3Directory & '/myPNGCopy.png').content_type & '<br>');//image/png (good)
fileWrite(myS3Directory & '/myText.txt', "CF");
writeOutput(storeGetMetadata(myS3Directory & '/myText.txt').content_type & '<br>');//application/octet-stream (bad)
fileCopy(myS3Directory & '/myText.txt', myS3Directory & '/myTextCopy.txt');
writeOutput(storeGetMetadata(myS3Directory & '/myTextCopy.txt').content_type & '<br>');//text/plain (good)
cfimage(action="write", source=myImage, destination=myS3Directory & '/myJPG2.jpg');
writeOutput(storeGetMetadata(myS3Directory & '/myJPG2.jpg').content_type & '<br>');//application/octet-stream (bad)
cffile(action="copy", source=myS3Directory & '/myJPG2.jpg', destination=myS3Directory & '/myJPG2Copy.jpg');
writeOutput(storeGetMetadata(myS3Directory & '/myJPG2Copy.jpg').content_type & '<br>');//image/jpeg (good)
cfimage(action="write", source=myImage, destination=myS3Directory & '/myPNG2.png');
writeOutput(storeGetMetadata(myS3Directory & '/myPNG2.png').content_type & '<br>');//application/octet-stream (bad)
cffile(action="copy", source=myS3Directory & '/myPNG2.png', destination=myS3Directory & '/myPNG2Copy.png');
writeOutput(storeGetMetadata(myS3Directory & '/myPNG2Copy.png').content_type & '<br>');//image/png (good)
cffile(action="write", file=myS3Directory & '/myText2.txt', output="CF");
writeOutput(storeGetMetadata(myS3Directory & '/myText2.txt').content_type & '<br>');//application/octet-stream (bad)
cffile(action="copy", source=myS3Directory & '/myText2.txt', destination=myS3Directory & '/myText2Copy.txt');
writeOutput(storeGetMetadata(myS3Directory & '/myText2Copy.txt').content_type & '<br>');//text/plain (good)
</cfscript>
Attachments:
Comments: