Last active
December 10, 2015 04:28
-
-
Save atma/4381055 to your computer and use it in GitHub Desktop.
uploader sample call & layout
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
<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> |
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
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