Created
December 7, 2011 20:26
-
-
Save akoumjian/1444476 to your computer and use it in GitHub Desktop.
plupload s3 django snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(document).ready(function () { | |
$('#uploader').plupload({ | |
runtimes : 'flash,silverlight', | |
url : '{{ s3.url }}', | |
max_file_size : '1000MB', | |
multipart: true, | |
multipart_params: { | |
'key': '{{ s3.key }}', // use filename as a key | |
// 'Filename': '{{ s3.key }}', // adding this to keep consistency across the runtimes | |
'acl': '{{ s3.acl }}', | |
'Content-Type': '{{ s3.content_type }}', | |
'success_action_status': '{{ s3.success_action_status }}', | |
'AWSAccessKeyId' : '{{ s3.aws_access_key }}', | |
'policy': '{{ s3.policy }}', | |
'signature': '{{ s3.signature }}' | |
}, | |
// optional, but better be specified directly | |
file_data_name: 'file', | |
// re-use widget (not related to S3, but to Plupload UI Widget) | |
multiple_queues: true, | |
// Specify what files to browse for | |
// filters : [ | |
// {title : "JPEG files", extensions : "jpg"} | |
// ], | |
// Flash settings | |
flash_swf_url : '{{ MEDIA_URL }}/js/plupload.flash.swf', | |
// Silverlight settings | |
silverlight_xap_url : '{{ MEDIA_URL }}/js/plupload.silverlight.xap' | |
}); | |
}); | |
</script> | |
<div id="uploader"> | |
Not working | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment