Created
December 8, 2012 20:13
-
-
Save latortuga/4241729 to your computer and use it in GitHub Desktop.
Setup Uploadify to upload directly to S3
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
var uploadify_data = { | |
'AWSAccessKeyId': '<%= @uploadify_data[:access_key] %>', | |
'bucket': '<%= @uploadify_data[:bucket] %>', | |
'acl': 'private', | |
'key': '<%= @uploadify_data[:key] %>${filename}', | |
'signature': '<%= @uploadify_data[:signature] %>', | |
'policy': '<%= @uploadify_data[:policy] %>', | |
'success_action_status': '<%= @uploadify_data[:sas] %>', | |
'folder': '', | |
'Filename': '' | |
} | |
function uploadify_success(file, data, response) { } | |
$(document).ready(function() { | |
$('#contact_file_field').uploadify({ | |
swf: "<%= asset_path('uploadify.swf') %>", | |
uploader: "<%= @s3_url %>", | |
formData: uploadify_data, | |
fileSizeLimit: <%= @uploadify_data[:filesize] %>, | |
fileObjName: "file", // Necessary, DO NOT remove this. | |
onUploadSuccess: uploadify_success, | |
multi: true | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment