jQuery file upload to django request.FILES using jQuery.get? -


I need to change the code below to pass the file to a request. Files are currently in the file I I pass the place from the Django and allow it to open the file, unfortunately due to the new ridiculous set of network network restrictions, the Django will not have access to anything outside its server.

M passing comes from different types of html text input and one file.

I'm curious to change a little but if there is no other way?

  & lt; Script type = 'text / javascript' & gt; $ (Document) .ready (function () {jQuery.get (importUrl, {"file": fileInputData, "dir": dirInputData, "year": this all, "import": this import, "start date": start Date, "end date": end date, function (data) {jQuery.jGrowl (data, {sticky: true, header: "import result"});});}); & Lt; / Script & gt;  

You can not upload files with Ajax, scripts are around to do this But they use it to submit data to an iframe (an actual form is submitted). See

I do not really know that "nothing will be accessed by Déjeneo beyond its servers." Restriction on file upload is to keep applications from being read and written on the client's computer. Originally all uploads have an actual & lt; Input type = "file" name = "file" & gt; Should come from . You use request.FILES ['name_of_the_file_input' '] to access data in an uploaded file in Django.


Comments