Rank: Member
Groups: Member
Joined: 10/23/2009(UTC) Posts: 26
Thanks: 3 times
|
How do you control the destination filename on S3? I don't want it to be the original filename, instead I want to generate my own filename, e.g. userxxx-xxx.jpg Looks like as3.converters is the place for it, but if I have multiple files, I want to set destination filename for each image.
as3.converters([{ acl: 'public-read', key: 'FilesWithMetadataAsp/${filename}',.... }
Thank you!
|
|
|
|
Rank: Member
Groups: Joined: 4/12/2016(UTC) Posts: 12
Was thanked: 3 time(s) in 3 post(s)
|
Hello. You can set a new name to a file at fileCount change or before send request event. Available events: https://www.aurigma.com/...s_ImageUploaderFlash.htmQuote:var newName = "userxxx-xxx.jpg"; function onBeforeSendRequest(){ $au.imageUploaderFlash('uploaderID').files().get(0).name(newName) }
Each time when a file is uploaded, the file will be removed from a list. And when you get the file with index 0 at onBeforeSendRequest, you will take next file. Edited by user Monday, January 16, 2017 3:00:09 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Member
Groups: Member
Joined: 10/23/2009(UTC) Posts: 26
Thanks: 3 times
|
beforeSendRequest wouldn't work, the filename gets updated in the files array, but the old name is posted to S3. I used beforeUpload event instead and that worked!
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.