Re: upload files via ajax
http://www.swfupload.org/ is all You need :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: upload files via ajax
On Thu, Dec 23, 2010 at 9:39 AM, Mauro wrote: > Hello, > is it possible to upload files via ajax? > > I would like to upload multiple files in my application but i have the > following exception: > > MultiPartParserError: Invalid boundary in multipart: None > > I'm using django 1.1. > The ajax request has the content type header set as mulitpart/form- > data > This was recently posted to the Mozilla Webdev blog. Might help you: http://blog.mozilla.com/webdev/2010/09/17/django-and-ajax-image-uploads/ -Paul -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: upload files via ajax
On 23 Dic 2010, 23:12, Paul Osman wrote: > On Thu, Dec 23, 2010 at 9:39 AM, Mauro wrote: > > Hello, > > is it possible to upload files via ajax? > > > I would like to upload multiple files in my application but i have the > > following exception: > > > MultiPartParserError: Invalid boundary in multipart: None > > > I'm using django 1.1. > > The ajax request has the content type header set as mulitpart/form- > > data > > This was recently posted to the Mozilla Webdev blog. Might help you: > > http://blog.mozilla.com/webdev/2010/09/17/django-and-ajax-image-uploads/ > > -Paul Hi, thanks for replying, but would like to choose the files at once and then upload them one by one (without flash, only html). Using an ajax request, django returns the MultiParseError. Moreover i try to user request._post_raw_data, but i would like to send also some other informations together with the files, and i do not to retrieve them from raw_data, Any other idea? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: upload files via ajax
On 11 January 2011 11:28, Jani Tiainen wrote: > On Monday 10 January 2011 16:05:13 Mauro wrote: >> On 23 Dic 2010, 23:12, Paul Osman wrote: >> > On Thu, Dec 23, 2010 at 9:39 AM, Mauro wrote: >> > > Hello, >> > > is it possible to upload files via ajax? >> > > >> > > I would like to upload multiple files in my application but i have the >> > > following exception: >> > > >> > > MultiPartParserError: Invalid boundary in multipart: None >> > > >> > > I'm using django 1.1. >> > > The ajax request has the content type header set as mulitpart/form- >> > > data >> > >> > This was recently posted to the Mozilla Webdev blog. Might help you: >> > >> > http://blog.mozilla.com/webdev/2010/09/17/django-and-ajax-image-uploads/ >> > >> > -Paul >> >> Hi, thanks for replying, but would like to choose the files at once >> and then upload them one by one (without flash, only html). Using an >> ajax request, django returns the MultiParseError. Moreover i try to >> user request._post_raw_data, but i would like to send also some other >> informations together with the files, and i do not to retrieve them >> from raw_data, >> Any other idea? > > First at all this is not possible. It is not possible send files using ajax. Yes you can: http://www.w3.org/TR/XMLHttpRequest2/ This only works fully in Firefox 4 and Webkit browsers (last I tested). Firefox 3.6 lacks the FormData object, but has an API to read files from JavaScript, so you can form-encode the data yourself and use xhr.send(). An almost complete implementation can be seen here: http://code.google.com/p/jquery-html5-upload/. > > But you can use ajaxy like approach. Common way is to create (invisible) > iframe where you clone original form and just do normal post there. > > When iframe loads you can post back response from server to your application. > It's not fully ajax but as close as it can get without using flash. I call this HTML4 fallback. I have a whole jQuery plugin that transparently uses an IFrame if the user's browser doesn't have any of required HTML5 capabilities. It lets you upload multiply files with additional POST data (e.g. file description, tags). Sadly, I can't open-source it just yet. -- Łukasz Rekucki -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: upload files via ajax
On 11 Gen, 12:05, Łukasz Rekucki wrote: > On 11 January 2011 11:28, Jani Tiainen wrote: > > > > > > > On Monday 10 January 2011 16:05:13 Mauro wrote: > >> On 23 Dic 2010, 23:12, Paul Osman wrote: > >> > On Thu, Dec 23, 2010 at 9:39 AM, Mauro wrote: > >> > > Hello, > >> > > is it possible touploadfiles viaajax? > > >> > > I would like touploadmultiple files in my application but i have the > >> > > following exception: > > >> > > MultiPartParserError: Invalid boundary in multipart: None > > >> > > I'm using django 1.1. > >> > > Theajaxrequest has the content type header set as mulitpart/form- > >> > > data > > >> > This was recently posted to the Mozilla Webdev blog. Might help you: > > >> >http://blog.mozilla.com/webdev/2010/09/17/django-and-ajax-image-uploads/ > > >> > -Paul > > >> Hi, thanks for replying, but would like to choose the files at once > >> and thenuploadthem one by one (without flash, only html). Using an > >>ajaxrequest, django returns the MultiParseError. Moreover i try to > >> user request._post_raw_data, but i would like to send also some other > >> informations together with the files, and i do not to retrieve them > >> from raw_data, > >> Any other idea? > > > First at all this is not possible. It is not possible send files usingajax. > > Yes you can:http://www.w3.org/TR/XMLHttpRequest2/This only works > fully in Firefox 4 and Webkit browsers (last I tested). Firefox 3.6 > lacks the FormData object, but has an API to read files from > JavaScript, so you can form-encode the data yourself and use > xhr.send(). An almost complete implementation can be seen > here:http://code.google.com/p/jquery-html5-upload/. > > > > > But you can use ajaxy like approach. Common way is to create (invisible) > > iframe where you clone original form and just do normal post there. > > > When iframe loads you can post back response from server to your > > application. > > It's not fullyajaxbut as close as it can get without using flash. > > I call this HTML4 fallback. I have a whole jQuery plugin that > transparently uses an IFrame if the user's browser doesn't have any of > required HTML5 capabilities. It lets youuploadmultiply files with > additional POST data (e.g. file description, tags). Sadly, I can't > open-source it just yet. > > -- > Łukasz Rekucki Thanks a lot! It seems very interesting! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: upload files via ajax
On Tue, Jan 11, 2011 at 1:12 PM, Jani Tiainen wrote: > > http://valums.com/ajax-upload/ > > There is one standalone version how to do it pretty much browser > independently. > > > > -- > > Jani Tiainen > It seems to be what i am looking for, thanks! > > > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: upload files via ajax
I'm using Plopload http://plupload.com it's very nice!! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: upload files via ajax
On 2011-01-11, at 13:12 , Jani Tiainen wrote: > > I think Dojotoolkit and ExtJS both have nice mechanisms to do this ootb so no > need to reinvent the wheel. I've never been fan of jquery so I don't know is > there something for them (or for other similiar pure js frameworks) For jquery, the `jquery-forms` plugin handles that, though it's not entirely transparent (I don't expect it to be on Dojo or Ext) when it has to rely on iframes, as it's e.g. not possible to set headers on iframe requests. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.