Copy link to clipboard
Copied
I have found my needs go beyond what was released with the CF9 hotfix and most code examples are about 3 years old.
I have the following necesseary tasks
1.) List contents in a bucket "folder style". CF's directoryList() seems get all objects with a prefix and does not support the deliminiter required to not return object in a "sub-directory"
2.) Generate and upload form for clients
3.) Generate and expirable link for private objects
Can someone point me to some code that might help accomplish all three. I'm also looking at AWS's Java library, but it looks daunting.
Copy link to clipboard
Copied
You can do 1) your self using the listXxx() functions to strip off the last item, I think...
You have to post the code you are using, along with details of what you have in S3.
2) is just writing a sting to a file - CFFile will work on S3 fine.
3) You mean using S3/CloudFront signed URLs ? This is fairly advanced, and I've not seen any open code to do it. Why not just copy the file to a unique location, and delete when your system knows the timeout has expired ?
Tom
Copy link to clipboard
Copied
1.) I'm not sure what listxxx, but I dont' want to strip anyting after querying S3, what if I have thounsands of objects. S3's REST listObjects supports the delimiter to only return objects with the Key prefix your looking for, coldfusion does not support this it looks like.
2.) You mis understand, I'm looking to signed forms so I can have custom client uploads to my S3 bucket.
3.) No, just regular links that are signed and expire? Cloudfront has nothing to do with. Two of the more popular peices of code I have seen out there (s3 rest wrapper and amazons3.cfc) both break when creating these links for file names with spaces in them.
I have started hacking the code buy these two guys Barney Boisvert and Joe Danziger (s3 rest wrapper and amazons3.cfc) and am just building an updated set of scripts to do what I want it to do, I also found these guys http://www.element-it.com, that make it pretty easy to build multi upload forms for you s3 buckets as well.
It is just really surpising the lack of code out there for this and I was hoping that there was some underlying JAVA objects exposed to CF since they have partial integration.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now