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



Go to last post Go to first unread
#1 Posted : Monday, March 1, 2010 3:39:00 PM(UTC)

Rank: Newbie

Groups: Member
Joined: 2/11/2010(UTC)
Posts: 4

how do i add a unique identifier for the files i uploaded with S3 in C#? It currently uses $.filename, BUT what control where i can do something where i give it a unique GUID for each file when it loops through the files.

#2 Posted : Wednesday, March 3, 2010 3:24:40 AM(UTC)

Rank: Advanced Member

Groups: Administration
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)

You can add unique name for each file using the following code:
var iu = new ImageUploaderWriter("ImageUploader1", 650, 400);
// other params...

iu.addEventListener("PackageBeforeUpload", "packagebeforeupload");
// other params...


function packagebeforeupload(packageIndex){
    //get image uploader
    var u = getImageUploader("ImageUploader1");
    //get uploaded file name
    var sourceName = u.getUploadFileName(1);
    //get timestamp
    //we save timestamp value to array to use the same value for original file and its thumbnails
    timestamps['' + sourceName] = timestamps['' + sourceName] || +new Date; // use saved value or create new
    //get extension
    var ext = sourceName.split(".");
    ext = ext[ext.length - 1];
    //get name
    var name = sourceName.split(".");
    name = name.join('.');
    //manual add filed with filename value
    u.addField("key", folder + name + '_' + timestamps[sourceName] + '.' + ext);
Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!
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.