Issues
Requesting Support for StoreSetMetaData() and StoreGetMetaData()
Description
Environment
relates to
Details
Assignee
Michael OffnerMichael OffnerReporter
Todd KinghamTodd KinghamPriority
NewNew 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
Affects versions
Details
Details
Assignee
Reporter
Priority
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
Affects versions
Activity
Todd Kingham27 December 2016 at 05:23
Okay, It's been almost a year and it's time to revisit this. When I left off I never got StoreSetMetaData() to work so we just starting using the AWS SDK. But I really wanted to get Lucee to do this natively so I could stop having to include a bunch of extra jar files in our .war deployment. So, we upgraded to Lucee5 and upgraded to the latest S3 extension. 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));
So... 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.
Michael Offner28 January 2016 at 15:43
please reopen with more details when you still have this issue with the most recent version
Michael Offner27 January 2016 at 17:29
this functions are supported with the S3 Extension that is installed by default with a fresh install or an update from 4.5, BUT this extensions are not installed when doing an update from an older Lucee 5 Beta installation, in taht case you have to install the S3 extension in the admin.
There are even testcases for this functions:
https://github.com/lucee/Lucee/blob/master/test/functions/StoreMetaData.cfc
that need to pass, otherwise travis would not made a build.
Maybe you have to be more percise with what is happeing when you call this functions...
I noticed that StoreSetMetaData() is unsupported in Lucee though it's been available in ACF since 9. I'm curious as to why it's unsupported but more importantly how can I set meta data? I suppose I could download the AWS SDK but it's such a simple task and there is already so much integration with S3 it seems like such a waste of effort to go through. If there is no inherent reason why these functions are unsupported I would like to request they be added into the Lucee project as they are IMHO a core part of S3 functionality.