Created
December 2, 2014 22:40
-
-
Save stevewaffles/51c44150255d4fd2383e to your computer and use it in GitHub Desktop.
FilePicker upload to Acclaim
This file contains hidden or 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
| filepicker.setKey('Ar6ip0fB0RbyQ2LuJnyB4z'); | |
| filepicker.pickAndStore({services:['computer']}, {location:"S3"}, function(response) { | |
| upload_finished(response); | |
| }); | |
| function upload_finished(response) { | |
| $.ajax({ | |
| url: '/media/add/780', | |
| type: "POST", | |
| cache: false, | |
| dataType: 'json', | |
| data:{ | |
| "data[name]": response[0].filename, | |
| "data[key]": response[0].key, | |
| "data[Media][filepicker_url]": response[0].url | |
| } | |
| }).done(function(data) { | |
| $('#mediaArea').load($('#mediaIndex').attr('href')); | |
| $(".alert").remove(); | |
| $(".projects").prepend('<div id="flashMessage" class="alert alert-success"><button type="button" class="close" data-dismiss="alert">×</button>Your videos have been uploaded successfully!</div>'); | |
| $('.main-container').trigger('fade-alert'); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment