Skip to content

expose key to 's3_upload_complete' #141

Open
nesQuick opened this Issue Dec 4, 2013 · 0 comments

1 participant

@nesQuick
nesQuick commented Dec 4, 2013
In order to easily post-process the uploaded data
As a developer
I want to directly access the raw S3 key in the event data

For example if I want to move / rename a uploaded file after the upload from my rails app I have to remove the prepanded slash and decode the data.

old_key = params[:filepath]
old_key[0] = "" #replace prepended / ##e.g. /uploads/hash-hash/file.ext
old_key = URI.unescape old_key # unescape s3 key

So it would be nice to have the raw "key" in the content variable which is passed to the mentioned event.

I guess the solution should be somewhere in here https://github.com/waynehoover/s3_direct_upload/blob/fb5230d3c60f416369621a004f7da31b1d910d09/app/assets/javascripts/s3_direct_upload.js.coffee#L119-L136

The AWS XML respinse even contain that information.

Thanks and happy happing.

P.S.
Oh and did I mention thanks for that awesome work 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.