Issues
StoreSetMetadata() does not actually change file permissions in S3
Description
Environment
Mac OSX running JEE deployment of Lucee 5 on Tomcat 8
relates to
Details
Assignee
Michael OffnerMichael OffnerReporter
Todd KinghamTodd KinghamPriority
CriticalLabels
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
NoneAffects versions
Details
Details
Assignee
Reporter
Priority
Labels
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
Affects versions
Activity
Michael Offner20 March 2017 at 13:14
Michael Offner13 March 2017 at 11:10
Pothys - MitrahSoft25 January 2017 at 05:31
@Michael Offner Actually the problem here is the ability to download the file(.txt here). After setting content disposition(metadata), still the contents are being displayed, instead of downloading. So we couldn't add testcases for it.
Michael Offner19 January 2017 at 08:25
@Pothys - MitrahSoft can we do a testcase for this?
Pothys - MitrahSoft27 December 2016 at 12:16
I've analyzed this ticket a lot & confirmed the issue happened. If we add text file with StoreSetMetadata function having "Content-Disposition":"download" to download the text file. In Lucee5 couldn't able to download the text file. It simply redirect to that page. when dump StoregetMetadata(), it seems as expect, but permissions are not actually changed.
It's been almost a year since I reported having troubles with StoreSetMetadata() and it's time to revisit this. The function now exists meaning I no longer get a reference error when calling StoreSetMetadata(). However, I believe it's still not working correctly. Below is some example code:
/*** assuming we set our S3 credentials in Application.cfc and the bucket has the correct policy for downloads ***/
param name="url.filename" default="test.txt";
myFile = "s3://mybucket/#url.filename#";
fileWrite(myFile,"Sample s3 text");
StoreSetMetadata(myFile,{
"Content-Type":"text/plain",
"Content-Disposition":"download"
});
writeOutput('<a href="https://s3.amazonaws.com/mybucket/#url.filename#">download</a>');
writeDump(StoreGetMetadata(myFile));
When I run this code in ACF11 it downloads fine and when I log into S3 I can see permissions are changed. However, when I run this in Lucee5 the dump shows the meta data as being set but in S3 the permissions are not actually changed and when I try to download it just takes me to the page instead of downloading. Again, I'm not getting any errors anymore but it doesn't seem to actually be setting the Metadata on S3.