-
19 May 2009 12:05 PM #21
Yeah...both doc and doc.body are undefined. I'm using an API I have no control over, so I can't control how the response comes in. The browser displays their XML response just fine, but because Ext is using "contentDocument" or "document", the response cannot be read...even though it's there.
-
19 May 2009 12:09 PM #22
I really run out of ideas...
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
19 May 2009 12:10 PM #23
I do appreciate the help...it's baffling me as well.
-
20 May 2009 1:28 AM #24
I can agree that the responseXML isn't being returned properly, but Ext tries to grab the XML returned by the document.
That being said, I can still grab the response content.
HTML
CODECode:<body> <form id="foo"> <input type="file" /> </form> </body>
DATACode:Ext.onReady(function(){ var btn = new Ext.Button({ text: 'Foo', renderTo: document.body, handler: function(){ Ext.Ajax.request({ url: 'data.asp', isUpload: true, form: Ext.getDom('foo'), success: function(r){ console.log(r); } }); } }); });
Code:<?xml version="1.0" encoding="UTF-8"?> <rsp stat="ok"> <doc_id>15345909</doc_id> <access_key>key-xxxxxxxxxxxxxxxxxxxxx</access_key> </rsp>
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
20 May 2009 11:54 AM #25
This must be a problem with the contentType of the response (which is "application/xml"), b/c I'm still getting an empty response.
I created a test Scribd account. Try running this, a variation of what you sent:
HTML
CODECode:<body> <form id="foo"> <input type="file" name="file" /> </form> </body>
Code:Ext.onReady(function(){ var btn = new Ext.Button({ text: 'Foo', renderTo: document.body, handler: function(){ Ext.Ajax.request({ url: 'http://api.scribd.com/api?method=docs.upload&api_key=30m3pu0z4lhzsnz0mewfv', isUpload: true, form: Ext.getDom('foo'), success: function(r){ console.log(r); } }); } }); });
-
20 May 2009 6:04 PM #26
Whenever I try to post to that URL I get a 500 error.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
21 May 2009 10:41 AM #27
Not sure about the 500 error. I've tried that exact code on several platforms and browsers at this point. The upload works, but I'm still getting this response:
Code:argument: undefined responseText: "" responseXML: undefined
-
21 May 2009 4:12 PM #28
Perhaps this is all because these calls are being done cross-domain.
I want to reiterate, when I hack the code to make it so the iframe, which Ext.Ajax.request creates for uploads, is visible and doesn't remove itself, the XML is there. The browser is reading it. It's a REST response.
My problem is that Ext is telling me that it's not there.
-
28 May 2009 11:37 AM #29
Not sure if this is related, but I was having basically the same problem, but with JSON responses and file uploads on IE7/8. All of my headers were correct (html and utf-8), but for some reason the responseText was still empty. I was returning a status of 400, success flag false, and some json response text. This triggered the "success" handler (which I believe is documented) but caused a Syntax error on IE during json decode since it was an empty string.
I changed the response status to 200 (success, even though it was a failure) and everything works fine. We already had code checking the success flag on our success handler since fileUpload calls always trigger the success handler. So I suggest forcing success, if that's not what you're already doing.
-
3 Jul 2009 12:43 PM #30
Same problem, please help (PRETTY PLEASE, with sugar on top....)
Same problem, please help (PRETTY PLEASE, with sugar on top....)
I have the exact same issue, but my request is NOT being made cross domain. The actual domain is changed here, but basically, I have a page at "foo.bar.baz.com", and then I'm creating an Ext form on the page, which has a file input, and programmatically calling form.submit(). The url of the form is "/somepage.html" -- which of course means it's in the same domain.
I traced the issue to the same chunk of code the OP of this thread did, and I've determined that for some weire reason (and in all browsers)... the document property (and window, and other properties) of the iframe are marked as "Access Denied" (which to me looks like the browser is treating the issue as cross domain.
So can someone explain why this might be happening? Is it because I'm using a domain with multiple subdomains? That seems odd to me if that's the actual issue here.
Anyone?Ryan Gahl
Manager, Senior Software Engineer
Nth Penguin, LLC
www.nthpenguin.com
---
Architect
WebWidgetry.com / Mashupstudio.com
Future Home of the World's First Complete Web Platform
---
Blog: http://www.someElement.com
Inquire: 262-951-6727


Reply With Quote