Skip to content

Instantly share code, notes, and snippets.

@jecyhw
Last active December 29, 2016 00:33
Show Gist options
  • Save jecyhw/ea13b13719790bcfd54b5af647d8753d to your computer and use it in GitHub Desktop.
Save jecyhw/ea13b13719790bcfd54b5af647d8753d to your computer and use it in GitHub Desktop.
var pluploadOptions = {
runtimes : 'html5,flash,silverlight,html4',
flash_swf_url : addBasePath('plugin/plupload/Moxie.swf'),
silverlight_xap_url : addBasePath('plugin/plupload/Moxie.xap'),
multi_selection: false,
file_data_name: 'file',
multipart_params : {
_csrf: token
},
filters : {
max_file_size : '20mb',
mime_types: [
{title : "Image files", extensions : "jpg,gif,png"}
]
}
};
var uploader = new plupload.Uploader($.extend(pluploadOptions, {
container: pan.get(0),
browse_button: pan.find('button[name="file"]').get(0),
url: this.url,
init: {
PostInit: function () {
},
FilesAdded: function (up, files) {
},
BeforeUpload: function (up, files) {
},
UploadProgress: function (up, file) {
},
Error: function (up, err) {
},
FileUploaded: function (up, file, result) {
}
}
}));
uploader.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment