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

Notification

Icon
Error

Options
Go to last post Go to first unread
zhenl  
#1 Posted : Tuesday, September 14, 2010 4:57:16 PM(UTC)
zhenl

Rank: Member

Groups: Member
Joined: 10/16/2009(UTC)
Posts: 23

Thanks: 4 times
Hello,

I have built an application to upload original image and a thumbnail to s3 successfully by following your demo of asp.net. Now we need upload 3 images(original, large image with watermark and a small thumbnail image) to s3. However, the image uploader seems only allow upload two images. I meet an error during uploading:"You have selected to upload source file. In this case you should set the policy,key, ACL and signature using the follow medthods.." However I have set those fields in both ascx and behide code as below:

I set up this in the ascx file.

Code:
<cc2:AmazonS3Extender ID="AmazonS3Extender1" runat="server">
<SourceFile Acl="authenticated-read" Key="original/${filename}">
		</SourceFile>
		<Thumbnail1 Acl="authenticated-read" Key="largethumb/${filename}">
		</Thumbnail1>
		<Thumbnail2 Acl="public-read" Key="thumb/${filename}">
		</Thumbnail2>
</cc2:AmazonS3Extender>

And I set up in vb code too:

Code:
Me.AmazonS3Extender1.SecretAccessKey = Me.S3SecurityKey
Me.AmazonS3Extender1.AWSAccessKeyId = Me.S3AccessKey
Me.AmazonS3Extender1.Bucket = Me.S3Bluk
Me.AmazonS3Extender1.SourceFile.Acl = "authenticated-read"
Me.AmazonS3Extender1.SourceFile.Key = Me.S3Folder & "original/${filename}"
Me.AmazonS3Extender1.Thumbnail1.Acl = "authenticated-read"
Me.AmazonS3Extender1.Thumbnail1.Key = Me.S3Folder & "largethumb/${filename}"
Me.AmazonS3Extender1.Thumbnail2.Acl = "public-read"
Me.AmazonS3Extender1.Thumbnail2.Key = Me.S3Folder & "thumb/${filename}"

I checked the generated code and found that there is not settings for the SourceFile.

Code:
function dnn_ctr843_ViewMyMediaGalleryUploader_AmazonS3Extender1_InitWriter(writer) {
	writer.removeParam("Action");
	var as3 = new AmazonS3Extender(writer);
	window["dnn_ctr843_ViewMyMediaGalleryUploader_AmazonS3Extender1"] = as3;
	as3.setAWSAccessKeyId("******");
	as3.setBucket("testbluck");
	as3.getThumbnail1().setAcl("authenticated-read");
	as3.getThumbnail1().setKey("0/1/25/largethumb/${filename}");
	as3.getThumbnail1().setPolicy("eyAiZXhwaXJhdGlvbiI6ICIyMDEwLTA2LTMwVDAzOjI0OjMzLjAwMFoiDQosICJjb25kaXRpb25zIjogWw0KCXsiYWNsIjogImF1dGhlbnRpY2F0ZWQtcmVhZCIgfQ0KCSwgeyJidWNrZXQiOiAidGVzdGJsdWNrIiB9DQoJLCB7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6ICIyMDAifQ0KCSwgWyJzdGFydHMtd2l0aCIsICIka2V5IiwgIjAvMS8yNS9sYXJnZXRodW1iLyJdDQpdDQp9DQo=");
	as3.getThumbnail1().setSignature("96ZkaGICNFMwzU+jnE8GFgrrrVU=");
	as3.getThumbnail2().setAcl("public-read");
	as3.getThumbnail2().setKey("0/1/25/thumb/${filename}");
	as3.getThumbnail2().setPolicy("eyAiZXhwaXJhdGlvbiI6ICIyMDEwLTA2LTMwVDAzOjI0OjMzLjAwMFoiDQosICJjb25kaXRpb25zIjogWw0KCXsiYWNsIjogInB1YmxpYy1yZWFkIiB9DQoJLCB7ImJ1Y2tldCI6ICJ0ZXN0Ymx1Y2siIH0NCgksIHsic3VjY2Vzc19hY3Rpb25fc3RhdHVzIjogIjIwMCJ9DQoJLCBbInN0YXJ0cy13aXRoIiwgIiRrZXkiLCAiMC8xLzI1L3RodW1iLyJdDQpdDQp9DQo=");
	as3.getThumbnail2().setSignature("0mqyEIzySy5B8Bwwh+tIDBEdXuk=");
}

And I do more test on it. If I remove the thumbnail1 and add thumbnail3, the source file will be set but the thumbnail3 is not be set. The thumbnail2 will be set twice.

Code:
function dnn_ctr398_ViewMyMediaGalleryUploader_AmazonS3Extender1_InitWriter(writer) {
	writer.removeParam("Action");
	var as3 = new AmazonS3Extender(writer);
	window["dnn_ctr398_ViewMyMediaGalleryUploader_AmazonS3Extender1"] = as3;
	as3.setAWSAccessKeyId("*****");
	as3.setBucket("testbluck");
	as3.getThumbnail1().setAcl("authenticated-read");
	as3.getThumbnail1().setKey("0/1/1/original1/${filename}");
	as3.getThumbnail1().setPolicy("eyAiZXhwaXJhdGlvbiI6ICIyMDEwLTA5LTE2VDA3OjM1OjIwLjAwMFoiDQosICJjb25kaXRpb25zIjogWw0KCXsiYWNsIjogImF1dGhlbnRpY2F0ZWQtcmVhZCIgfQ0KCSwgeyJidWNrZXQiOiAidGVzdGJsdWNrIiB9DQoJLCB7InN1Y2Nlc3NfYWN0aW9uX3N0YXR1cyI6ICIyMDAifQ0KCSwgWyJzdGFydHMtd2l0aCIsICIka2V5IiwgIjAvMS8xL29yaWdpbmFsMS8iXQ0KXQ0KfQ0K");
	as3.getThumbnail1().setSignature("UdcNRVoSYOvQ5//28cgQAQQ3Jcg=");
	as3.getThumbnail2().setAcl("public-read");
	as3.getThumbnail2().setKey("0/1/1/thumb/${filename}");
	as3.getThumbnail2().setPolicy("eyAiZXhwaXJhdGlvbiI6ICIyMDEwLTA5LTE2VDA3OjM1OjIwLjAwMFoiDQosICJjb25kaXRpb25zIjogWw0KCXsiYWNsIjogInB1YmxpYy1yZWFkIiB9DQoJLCB7ImJ1Y2tldCI6ICJ0ZXN0Ymx1Y2siIH0NCgksIHsic3VjY2Vzc19hY3Rpb25fc3RhdHVzIjogIjIwMCJ9DQoJLCBbInN0YXJ0cy13aXRoIiwgIiRrZXkiLCAiMC8xLzEvdGh1bWIvIl0NCl0NCn0NCg==");
	as3.getThumbnail2().setSignature("G5w4mi8RbDLhojMHUPwj4P9VXZ8=");
	as3.getThumbnail2().setAcl("public-read");
	as3.getThumbnail2().setKey("0/1/1/thumb1/${filename}");
	as3.getThumbnail2().setPolicy("eyAiZXhwaXJhdGlvbiI6ICIyMDEwLTA5LTE2VDA3OjM1OjIwLjAwMFoiDQosICJjb25kaXRpb25zIjogWw0KCXsiYWNsIjogInB1YmxpYy1yZWFkIiB9DQoJLCB7ImJ1Y2tldCI6ICJ0ZXN0Ymx1Y2siIH0NCgksIHsic3VjY2Vzc19hY3Rpb25fc3RhdHVzIjogIjIwMCJ9DQoJLCBbInN0YXJ0cy13aXRoIiwgIiRrZXkiLCAiMC8xLzEvdGh1bWIxLyJdDQpdDQp9DQo=");
	as3.getThumbnail2().setSignature("MygZMb38zg4lykJJJmJvLjG0QIc=");
}
function dnn_ctr398_ViewMyMediaGalleryUploader_imgUploader_RemoveControlId() {
	getImageUploader('dnn_ctr398_ViewMyMediaGalleryUploader_imgUploader').RemoveField('ASPNET_ControlId');
}

How can I upload 3 images(original, large image with watermark and a small thumbnail image) to s3?

Regards

Lei

Edited by moderator Thursday, December 2, 2010 11:48:29 PM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#2 Posted : Wednesday, September 15, 2010 8:14:19 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

Thanks for contacting us.

I attached aspx file with particular settings of Image Uploader. It allows uploading three files: source file and two thumbnails (120x120 and 500x500). Please download and try it out in your project. If you have any additional questions or problems please feel free to let me know.

As for thumbnail3. Unfortunately, it is a bug. It will be fixed by our developers soon.

File Attachment(s):
amazonS3Sample.zip (3kb) downloaded 13 time(s).
Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

zhenl  
#3 Posted : Thursday, September 16, 2010 10:19:55 AM(UTC)
zhenl

Rank: Member

Groups: Member
Joined: 10/16/2009(UTC)
Posts: 23

Thanks: 4 times
Thanks Dmitry,

I'll try the demo.

Dmitry.Obukhov  
#4 Posted : Thursday, September 16, 2010 4:36:10 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

Please let me know about the results after trying the demo.

Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

zhenl  
#5 Posted : Sunday, November 7, 2010 6:59:19 PM(UTC)
zhenl

Rank: Member

Groups: Member
Joined: 10/16/2009(UTC)
Posts: 23

Thanks: 4 times
Hello Dmitry,

Sorry for the late response. Until last week I have time to test it. The demo works fine. Thanks very much for your help.

Regards

Lei

Dmitry.Obukhov  
#6 Posted : Sunday, November 7, 2010 9:12:18 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

Thank you for posting your comment. If you have any additional questions or problems, please feel free to let me know.

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.