Created
March 6, 2012 15:59
-
-
Save TheRyanBurke/1987027 to your computer and use it in GitHub Desktop.
jquery 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
offline_tracking.html | |
--------------------- | |
<script src="@{'/public/js/libs/fileupload/jquery.ui.widget.js'}"></script> | |
<script src="@{'/public/js/libs/fileupload/jquery.iframe-transport.js'}"></script> | |
<script src="@{'/public/js/libs/fileupload/jquery.fileupload.js'}"></script> | |
#{form @APICallScriptController.newCallScript(viewModel.rDnaId), id:'newScriptForm', enctype:'multipart/form-data'} | |
Script name: <input type="text" id="scriptName" name="name" /> | |
<br /> | |
<input type="file" id="fileupload" name="scriptFile" /> | |
<br /> | |
<input type="submit" name="submit" value="Upload New Script" /> | |
#{/form} | |
wizard-common.js | |
----------------- | |
$("#newScriptForm").submit(function(e) { | |
e.preventDefault(); | |
$("#fileupload").fileupload({ | |
//acceptFileTypes: '/(\.|\/)(txt)$/i', | |
dataType: 'json', | |
url: '/apicallscriptcontroller/newcallscript', | |
formData: { | |
rdnaid: controllerConstants.getRdnaId(), | |
authenticityToken: $(this).parent().find('input[name="authenticityToken"]').val() | |
}, | |
send: function(e, data) { | |
return true; | |
}, | |
done: function(e, data) { | |
ringDNA.calls.getCallScripts(); | |
} | |
}); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment