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

Notification

Icon
Error

Options
Go to last post Go to first unread
alfafado  
#1 Posted : Tuesday, August 10, 2010 7:58:41 PM(UTC)
alfafado

Rank: Member

Groups: Member
Joined: 6/29/2010(UTC)
Posts: 13

Hi,

I'd like to set the bucket on the fly, I found this topic (http://forums.aurigma.com/yaf_postst4078_Amazon-S3--Automatically-create-a-new-bucket.aspx) but I'm using the php version of the uploader, not the embedded version.

Is it possible to set a bucket on the fly without using the embedded uploader?

many thanks,

t

Edited by user Tuesday, August 10, 2010 8:00:36 PM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#2 Posted : Wednesday, August 11, 2010 8:52:34 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Administration
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello,

Thanks for contacting us.

I looked through Amazon S3 -- Automatically create a new bucket? post.
Sure, you can use the way offered in this post. It does not depend on how you embed Image Uploader on your page. You should include sendhelper.js file to your php page:
Code:

  <script type="text/javascript" src="sendhelper.js"></script>  

and then you should call functions implemented in this js file at run-time in JavaScript.

If you have any additional questions, please feel free to let me know.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
alfafado  
#3 Posted : Thursday, August 12, 2010 2:01:15 AM(UTC)
alfafado

Rank: Member

Groups: Member
Joined: 6/29/2010(UTC)
Posts: 13

Hi,

Many thanks for your reply.

I did try to implement this by using my current php code and by reconfiguring at runtime as you suggested. However when I added:

as3.getSourceFile().setKey(key + timestamp + '/${filename}');
as3.getThumbnail1().setKey(key + timestamp + '/${filename}');
as3.getThumbnail2().setKey(key + timestamp + '/${filename}');

to my 'send' function, I get a javascript error, that 'as3 is not defined'.

t
Dmitry.Obukhov  
#4 Posted : Thursday, August 12, 2010 7:54:59 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Administration
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello,

You should add new lines in Send method in sendhelper.js file:
Code:

function send() {
// New upload started, create new timestamp value
var timestamp = + new Date; // get current time in the numeric format

var as3;
// Find AmazonS3Extender in extenders array
for (var i = 0; i < ImageUploader1_w._extenders.length; i++) {
  if (ImageUploader1_w._extenders[i] instanceof AmazonS3Extender) {
   as3 = ImageUploader1_w._extenders[i];
   break;
  }
}

  // And reconfigure AmazonS3Extender
as3.getSourceFile().setKey(key + timestamp + '/${filename}');
as3.getThumbnail1().setKey(key + timestamp + '/${filename}');
as3.getThumbnail2().setKey(key + timestamp + '/${filename}');
totalFilesUploaded = 0;
uploadCount = 0;
cancelled = false;
var u = getImageUploader("ImageUploader1");
//save upload list
u.SaveUploadList(1);
//send files
u.Send();
}

Now it should work okay. If you have any problems, please feel free to let me know.

Edited by user Thursday, August 12, 2010 9:04:13 PM(UTC)  | Reason: Not specified

Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
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.