Created
July 24, 2013 05:50
-
-
Save kamikat/6068332 to your computer and use it in GitHub Desktop.
use iframe-transport with jasny bootstrap-fileupload
This file contains 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
// 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