Skip to content

Instantly share code, notes, and snippets.

@akoumjian
Created December 7, 2011 20:26
Show Gist options
  • Save akoumjian/1444476 to your computer and use it in GitHub Desktop.
Save akoumjian/1444476 to your computer and use it in GitHub Desktop.
plupload s3 django snippet
<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