On 02/01/2010 11:15 AM, Vladimir Dronnikov wrote: > Hi! > > Encoutered a problem: when submitting a file upload form via AJAX (by > means of jquery.form plugin, it uses <iframe/> technique when a <input > type="file" /> is in the form) analysing request.is_xhr is always > gives False. > > Googling has brought me > http://www.ender.com/2008/04/jquery-the-jquery-form-plugin.html > > In short, <iframe /> technique used doesn't set HTTP_X_REQUESTED_WITH > request header which is the only indicator for request.is_xhr that a > request was the AJAX one. However, if file field is being submitted, > request.environ contains a FieldStrorage, like: > ... > webob._parsed_post_vars (MultiDict([('Image--image', FieldStorage > ('Image--image', 'sss.zip'))]) > ... > > So how can I _reliably_ detect AJAX request? Does it make sense to > update request.is_xhr logic in Paste package itself? > > TIA, > -- > Vladimir > >
The iframe file upload technique is the only one available because you can't push files through xhr. So technically that isn't an XHR request. So I suppose you want to mark such uploads as being "asynchronous" to the page their iframes originate within? Vlad -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
