tag:blogger.com,1999:blog-381099180180950927.post2824222542118472543..comments2024-03-02T04:51:01.905-05:00Comments on Kuhl.IT: Ajax file uploads and CSRF (in Django 1.3, or possibly other frameworks)Anonymoushttp://www.blogger.com/profile/13076198147587091595noreply@blogger.comBlogger31125tag:blogger.com,1999:blog-381099180180950927.post-80502247659555902532012-12-06T08:22:14.318-05:002012-12-06T08:22:14.318-05:00correction i m getting the file copied but Failed ...correction i m getting the file copied but Failed is always writtenAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-10581775849256829592012-12-06T07:07:33.348-05:002012-12-06T07:07:33.348-05:00I have a problem. I get 'success' and '...I have a problem. I get 'success' and 'All complete' alerts but with the file that is uploaded 'Failed' is written on my modal and file is nowhere to be seen.<br /><br />I have the div on the modal. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-62351848385059604222012-11-18T15:30:39.589-05:002012-11-18T15:30:39.589-05:00@Salma I've not dealt with Amazon S3 so I have...@Salma I've not dealt with Amazon S3 so I have no idea how the interaction would happen. Sorry I can't be of more help!Anonymoushttps://www.blogger.com/profile/13076198147587091595noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-9877519509697697932012-11-18T09:02:13.359-05:002012-11-18T09:02:13.359-05:00Any Ideas how to adjust this if I am using Amazon ...Any Ideas how to adjust this if I am using Amazon S3 as my backend storage server.<br />Thanks a lot in advanceAnonymoushttps://www.blogger.com/profile/14249429098849968869noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-47081549726742359612012-09-05T08:29:20.345-04:002012-09-05T08:29:20.345-04:00Hey dude, thanks for replying, really appreciate i...Hey dude, thanks for replying, really appreciate it! Somehow, the problem I mentioned was fixed when I did it all over again using another project. I have questions though:<br />1. Can this have a remove attachment functionality? I want to add an ajax-powered link beside the name of the file that was successfully uploaded, that will remove the file from my database. <br /><br />2. What will I edit if I want to remove the adding of a list item below the button if the upload was successful? Actually, I only want non-image files to be shown in the list item (then add a link to remove the file as mentioned in Question #1)<br /><br />Thank you very much for taking time to read comments on your blog! :)Anonymoushttps://www.blogger.com/profile/10947805787797025458noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-61316039893117946302012-09-04T09:57:22.782-04:002012-09-04T09:57:22.782-04:00@pat It is pretty hard to track down since a 500 c...@pat It is pretty hard to track down since a 500 can be thrown in various places for various reasons. I have never had very sophisticated debugging techniques, but you can try throwing errors, returning other statuses (403 maybe), or print statements if you are using the django server to try to track down the specific line(s) that are causing the 500.Anonymoushttps://www.blogger.com/profile/13076198147587091595noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-62035394365763009592012-09-04T06:49:04.089-04:002012-09-04T06:49:04.089-04:00Help! I have a problem: the file is uploaded succe...Help! I have a problem: the file is uploaded successfully through ajax, but it during my tests it shows the alert "upload failed!". After uploading a file, the file is uploaded in my webserver, but the alert message that the upload failed is shown. In the chrome developer console, it showed an INTERNAL SERVER ERROR message. It's weird because I already double checked the code for the server-side script. Any help will be greatly appreciated.<br /><br />Thanks a lot for this very good stuff!Anonymoushttps://www.blogger.com/profile/10947805787797025458noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-66059516384761787902012-05-09T21:03:22.542-04:002012-05-09T21:03:22.542-04:00Thank you everyone for posting fixes, I will be in...Thank you everyone for posting fixes, I will be incorporating these into the version posted on Github soon.<br /><br />@David thanks for taking the time to comment, glad my code was of useAnonymoushttps://www.blogger.com/profile/13076198147587091595noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-72347925989034757702012-05-09T17:55:27.836-04:002012-05-09T17:55:27.836-04:00Dear sir, I've been flailing around trying to ...Dear sir, I've been flailing around trying to figure out how to do something like this, and your solution is exactly what I was looking for. +1000 points.David Colganhttps://www.blogger.com/profile/13557189309505037626noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-37384572969902349112012-05-04T19:40:04.916-04:002012-05-04T19:40:04.916-04:00Hi Alex, thanks a bunch for putting this together....Hi Alex, thanks a bunch for putting this together. I did find one typo: in the 'save_upload' python function I think there should be another 'return True' on line 18, so that success is reported when it's uploaded as raw data.Anonymoushttps://www.blogger.com/profile/17057053615110705443noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-20217114940042528002012-04-22T16:56:27.978-04:002012-04-22T16:56:27.978-04:00@shaker I had same problem. I found that this is w...@shaker I had same problem. I found that this is wrong parameter name in file js/fileuploader.js line #604 - "if( !self.multiple && e.dataTransfer.files.length > 1 )" instead of "if( !self._options.multiple && e.dataTransfer.files.length > 1 )"tughttps://www.blogger.com/profile/03017144981680499536noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-55199849682043844462012-04-21T09:18:39.357-04:002012-04-21T09:18:39.357-04:00This comment has been removed by the author.Tsachihttps://www.blogger.com/profile/13509998718706519155noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-14707380773973233132012-03-28T00:01:49.251-04:002012-03-28T00:01:49.251-04:00Hi Alex - I haven't altered the Javascript fro...Hi Alex - I haven't altered the Javascript from the example in your distribution, except to change the div ID, the reversed URL, and to change the alert! Here's what I'm using:<br /><br />http://dpaste.com/722551/<br /><br />Any suggestions welcome - hoping to give a demo of this tomorrow. <br /><br />Thanks for the great tutorial by the way.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-55234145130941718312012-03-27T17:36:14.465-04:002012-03-27T17:36:14.465-04:00@shacker I would suspect you have an error somewhe...@shacker I would suspect you have an error somewhere in your javascript but it is hard to tell. For this particular problem your Django version shouldn't matter.Anonymoushttps://www.blogger.com/profile/13076198147587091595noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-35570370710624473612012-03-27T17:31:10.163-04:002012-03-27T17:31:10.163-04:00Hmm, everything's working well, except that it...Hmm, everything's working well, except that it says "Multiple file uploads are disabled" even though it's set to true, just as in your example. Any ideas there? Using Django 1.4.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-27136986757381399342012-03-27T14:07:15.561-04:002012-03-27T14:07:15.561-04:00This comment has been removed by the author.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-15243655048983044612011-10-30T20:59:23.445-04:002011-10-30T20:59:23.445-04:00@Eli I have never been big on the Django admin so ...@Eli I have never been big on the Django admin so I never bothered with any integration there. What functionality would you like?<br /><br />@siddharthsarda I am not sure what the problem is, no one has ever brought that one up. Could be a browser issue? Without being able to replicate it I can't determine if there is a bug in my code.Anonymoushttps://www.blogger.com/profile/13076198147587091595noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-29975519326184272612011-10-14T02:56:22.903-04:002011-10-14T02:56:22.903-04:00Hi,
The request.method on the view side is unexpec...Hi,<br />The request.method on the view side is unexpectedly GET for me(instead of post).<br /><br />I have followed your instructions to the T. What might I be doing wrong?siddharthsardahttps://www.blogger.com/profile/14917475300260680196noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-36157648646109881232011-09-27T14:44:37.066-04:002011-09-27T14:44:37.066-04:00how to use this in the django admin?how to use this in the django admin?Elihttps://www.blogger.com/profile/16379655996517810886noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-18090868089864760332011-09-09T03:30:35.351-04:002011-09-09T03:30:35.351-04:00This comment has been removed by the author.wesleyzhaohttps://www.blogger.com/profile/17904327801342158777noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-44029078233213914482011-06-02T09:26:01.775-04:002011-06-02T09:26:01.775-04:00@Babu corrected, thanks for the bug hunting!@Babu corrected, thanks for the bug hunting!Anonymoushttps://www.blogger.com/profile/13076198147587091595noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-24065259223002187192011-06-02T09:00:00.566-04:002011-06-02T09:00:00.566-04:00hi! good guide!
I'm trying to make it all work...hi! good guide!<br />I'm trying to make it all working ;-)<br />...in the meantime I found 2 typos: <br />Javascript line 2: missing quotes around url;<br />in save_upload: in the try block return True is missingCinema Marconihttps://www.blogger.com/profile/12411093294624457604noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-59604639830457987862011-05-14T01:56:49.573-04:002011-05-14T01:56:49.573-04:00Alex, thanks for the great integration. I've ...Alex, thanks for the great integration. I've built out a class-based view that streams the files to S3, using your views as a base. <br /><br />Code's up on github - https://github.com/GoodCloud/django-ajax-uploader<br /><br />Thanks for the inspiration and readable code!aglzenhttps://www.blogger.com/profile/17131118360848447593noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-7708414685687687592011-05-11T12:37:17.457-04:002011-05-11T12:37:17.457-04:00How can I see thumbnail image after upload?How can I see thumbnail image after upload?Викторhttps://www.blogger.com/profile/10808176625752809161noreply@blogger.comtag:blogger.com,1999:blog-381099180180950927.post-88939964802872704972011-04-27T20:38:18.606-04:002011-04-27T20:38:18.606-04:00@adrian In the same place you pass the csrf params...@adrian In the same place you pass the csrf params, there is a parameter called 'multiple' you can use which, if given false, will allow only one at a time.Anonymoushttps://www.blogger.com/profile/13076198147587091595noreply@blogger.com