StoreSetMetaData() for S3

103 views
Skip to first unread message

Todd Kingham

unread,
Jan 10, 2016, 4:47:20 AM1/10/16
to Lucee
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 iit'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.  All I'm doing is creating a PDF on the fly using CFDOCUMENT and saving it to S3 so it can be downloaded. Unfortunately, it's default Content_Type is "Application" and the PDF is useless as I can't download it and I have (seemingly) no built-in way to programmatically switch this to "Application/pdf". Am I overlooking something obvious or am I out of luck?

Thanks in advance :)

Alex Skinner

unread,
Jan 17, 2016, 4:30:15 AM1/17/16
to lu...@googlegroups.com
Can you raise this on Jira if you haven't already

Thanks

Alex

On 10 January 2016 at 07:39, Todd Kingham <toddk...@gmail.com> wrote:
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 iit'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.  All I'm doing is creating a PDF on the fly using CFDOCUMENT and saving it to S3 so it can be downloaded. Unfortunately, it's default Content_Type is "Application" and the PDF is useless as I can't download it and I have (seemingly) no built-in way to programmatically switch this to "Application/pdf". Am I overlooking something obvious or am I out of luck?

Thanks in advance :)

--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/bde42d81-64e0-41aa-8e8e-f4cfbf01f692%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alex Skinner
Managing Director

Pixl8 Interactive, 3 Tun Yard, Peardon Street, London
SW8 3HT, United Kingdom



T: +44 [0] 845 260 0726 W: www.pixl8.co.uk E: in...@pixl8.co.uk




Follow us on: Facebook Twitter LinkedIn



CONFIDENTIAL AND PRIVILEGED - This e-mail and any attachment is intended solely for the addressee, is strictly confidential and may also be subject to legal, professional or other privilege or may be protected by work product immunity or other legal rules. If you are not the addressee please do not read, print, re-transmit, store or act in reliance on it or any attachments. Instead, please email it back to the sender and then immediately permanently delete it. Pixl8 Interactive Ltd Registered in England. Registered number: 04336501. Registered office: 8 Spur Road, Cosham, Portsmouth, Hampshire, PO6 3EB

Todd Kingham

unread,
Jan 19, 2016, 3:34:08 PM1/19/16
to lu...@googlegroups.com
Will do.

Thank you! :)

Todd Kingham

unread,
Dec 23, 2016, 1:25:57 PM12/23/16
to Lucee, al...@pixl8.co.uk
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.

Zac Spitzer

unread,
Dec 23, 2016, 7:46:08 PM12/23/16
to lu...@googlegroups.com, al...@pixl8.co.uk
Did you file an issue? posting the link back to the group helps everyone

To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Zac Spitzer
+61 405 847 168

Reply all
Reply to author
Forward
0 new messages