Using plupload inside a Django applicationFeeding the Cloud
<a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>
https://feeding.cloud.geek.nz/posts/using-plupload-inside-django/Feeding the Cloudikiwiki2012-11-04T04:30:26Zhttps://feeding.cloud.geek.nz/posts/using-plupload-inside-django/comment_1_ac8f57256273a42a0ba5ba59fb4f6a8f/Michael2012-11-04T04:30:26Z2011-04-12T20:39:53Z
<p>Hi Francois,</p>
<p>Question of the year: After the completed download I want a redirection to take place, do I have to hook in some JS event? I ask because the else statement of request.is_ajax() seems to never be executed. Unless I am doing something horribly wrong which might very well be <img alt=":)" src="https://feeding.cloud.geek.nz/smileys/smile.png" /></p>
<p>thanks and regards,<br />
Michele</p>
https://feeding.cloud.geek.nz/posts/using-plupload-inside-django/comment_2_9e4ca4ca8bbcafb6f4901c2f317f0117/François2012-11-04T04:30:26Z2011-04-12T21:27:33Z
<p>@Michele the else statement of "request.is_ajax()" is for when the non-Javascript version of the form is submitted.</p>
<p>Redirections would indeed have to be done in Javascript.</p>
https://feeding.cloud.geek.nz/posts/using-plupload-inside-django/comment_3_1152164e96ebdd2c1f670c2c2f995759/Michael2012-11-04T04:30:26Z2011-04-13T18:28:45Z
<p>Hi Francois,</p>
<p>thanks for the hint. It wasn't too obvious to me as there's no queue_finished event, but checking the number of uploads at every FileUploaded event did it.</p>
<p>thanks again and regards,<br />
Michele</p>
https://feeding.cloud.geek.nz/posts/using-plupload-inside-django/comment_4_2a4c4273d66987b97ee9505c0dadf10d/Titusz2012-11-04T04:30:26Z2011-06-10T13:17:12Z
<p>Hello,</p>
<p>I have been testing you django plupload integration and it works nice... could you talk a bit more about the secure temp_file issue?<br />
If I simple do a</p>
<p>file_obj, temp_file = tempfile.mkstemp()</p>
<p>it does not work as it creates a multiple tempfiles for an upload?<br />
Do you have a hint on how to go about this?</p>
<p>thanks<br />
Titusz</p>
https://feeding.cloud.geek.nz/posts/using-plupload-inside-django/comment_5_fc99571ab8b40092738b3b3e4635bb26/Unknown2012-11-04T04:30:26Z2012-02-23T21:56:24Z
<p>Titusz: How bout using the session_id ?</p>
<p>Found these in upload.php:</p>
<p>die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');<br />
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');<br />
die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}');<br />
die('{"jsonrpc" : "2.0", "result" : null, "id" : "id"}');</p>