Thx for help guys

this discussion covered in this post:
http://groups.google.com/group/turbogears/browse_thread/thread/df83e7e4e74131b1/530c61cc06cf56c4?lnk=gst&q=iframe+ajax&rnum=2#530c61cc06cf56c4

On Aug 13, 2:25 am, "Diez B. Roggisch" <[EMAIL PROTECTED]>
wrote:
> On Monday 13 August 2007 10:34:47 [EMAIL PROTECTED] wrote:
>
>
>
> > Hi
>
> > Apparently ajaxForm/remoteForm has a problem with a file form input.
> > If I dont' include the 'py:attrs' in the form tag declaration, then
> > the page will force a redirect on success...just like a normal form
> > rather than an AJAX form...this is not what I want. If I *do* include
> > the 'py:attrs" in the form tag, then the HTML substituted missing HTML
> > looks like this:  "onsubmit="return !remoteFormRequest(this, 'status',
> > {&quot;loading&quot;: null, &quot;confirm&quot;: null,
> > &quot;after&quot;: null, &quot;on_complete&quot;: null,
> > &quot;loaded&quot;: null, &quot;on_failure&quot;:
> > &quot;getElement('status').innerHTML='';&quot;,
> > &quot;on_success&quot;:
> > &quot;getElement('status').innerHTML='Submitted...';&quot;,
> > &quot;before&quot;:
> > &quot;getElement('status').innerHTML='Submitting...';&quot;});""
> > Doing this causes an error as seen below:
>
> >     filename = getRandomStr(4) + '_' +
> > os.path.basename(fileobj.filename)
> > AttributeError: 'unicode' object has no attribute 'filename'
> > Request Headers:
> >   COOKIE: tg-visit=09b3803694f3a69c91b5fcde87035124f73e63c9
> >   Content-Length: 105
> >   ACCEPT-CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> >   USER-AGENT: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US;
> > rv:1.8.0.12) Gecko/20070508 Firefox/1.5.0.12
> >   CONNECTION: close
> >   PRAGMA: no-cache
> >   CONTENT-LENGTH: 105
> >   HOST: localhost:8080
> >   CACHE-CONTROL: no-cache
> >   CONTENT-TYPE: application/x-www-form-urlencoded
> >   ACCEPT: text/xml,application/xml,application/xhtml+xml,text/
> > html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> >   Remote-Addr: 127.0.0.1
> >   ACCEPT-LANGUAGE: en-us,en;q=0.5
> >   Content-Type: application/x-www-form-urlencoded
> >   Remote-Host: 127.0.0.1
> >   ACCEPT-ENCODING: gzip,deflate
> >   KEEP-ALIVE: 300
>
> > My normal AJAX forms without file input fields work fine, and my file
> > input form that is NON-AJAX also works fine.  But putting them
> > together results in this error?
>
> > Possibly the file object is not being passed correct to the remote
> > form?  Anybody care to comment?
>
> I can't comment on the specific error - but one thing is for sure: one can't
> use AJAX with file input fields. The browser security model won't allow for
> that.
>
> Google this list for an image editor I once offered here where you can see the
> trick how to do this nontheless, using a hidden IFRAME as form action target.
>
> Diez


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to