Skip to content

Instantly share code, notes, and snippets.

@atma
Last active December 10, 2015 04:28
Show Gist options
  • Save atma/4381055 to your computer and use it in GitHub Desktop.
Save atma/4381055 to your computer and use it in GitHub Desktop.
uploader sample call & layout
<div id="sample-uploader-container" class="well">
<span id="sample-uploader-upload" class="btn"><i class="icon-upload"></i> Select</span> or drop here
</div>
<div id="sample-uploader-fileslist"></div>
var sampleUploader = new Uploader({
uploader: {
container: 'sample-uploader-container',
browse_button: 'sample-uploader-upload',
drop_element: 'sample-uploader-container',
flash_swf_url: 'plupload/plupload.flash.swf', // default "/Scripts/libs/uploader/plupload/plupload.flash.swf",
url: 'process.html', // default '/Handler/SubirArchivosHandler.ashx'
min_image_side: 320 // min_image_width|min_image_height|min_image_side|max_image_width|max_image_height|max_image_side
},
elements: {
fileslist: 'sample-uploader-fileslist'
},
callbacks: {
onSuccess: function (file, response) {
if (response.image) {
$('#sample-uploader-result').html($('<img/>', {src: response.image, width: 400, height: 200, alt: 'placeholder'}));
}
}
},
messagesHandler: function(err, type) {
alert(err);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment