Skip to content

Instantly share code, notes, and snippets.

@kamikat
Created July 24, 2013 05:50
Show Gist options
  • Save kamikat/6068332 to your computer and use it in GitHub Desktop.
Save kamikat/6068332 to your computer and use it in GitHub Desktop.
use iframe-transport with jasny bootstrap-fileupload
// First, you need download iframe-transport from following address
// https://github.com/cmlenz/jquery-iframe-transport/raw/master/jquery.iframe-transport.js
// Then, add <script/> tag to your page
$.ajax({
url: '<url to send file to>',
files: $('select the input:file html tags'),
iframe: true, // use iframe as ajaxTransport
success: function (data) {
// Here we got data(response from server)
// Workaround: re-initialize the fileupload (enable ui to show another file again)
$('.fileupload').fileupload('clear').removeData('fileupload').fileupload();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment