Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
steelhead  
#1 Posted : Friday, January 13, 2017 2:30:22 PM(UTC)
steelhead

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!

Alex Nikulin  
#2 Posted : Monday, January 16, 2017 12:27:04 AM(UTC)
Alex Nikulin

Rank: Member

Groups: Member
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.htm

Quote:
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

steelhead  
#3 Posted : Monday, January 16, 2017 7:54:37 AM(UTC)
steelhead

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!
Users browsing this topic
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.