Success handler not getting called in file upload using extjs

后端 未结 2 1571
暗喜
暗喜 2021-01-06 05:26

I have a J2EE web app with a form where I upload a file to a location on a server. During the upload a waitMsg is shown to the user which should disappear once the upload is

相关标签:
2条回答
  • 2021-01-06 05:29

    'uploadXML.htm' must be PHP or similar server side procedure. this PHP must return JSON string, like : {'success':true} or {'success':false}.

    0 讨论(0)
  • 2021-01-06 05:40

    Had a similar problem. Found out that you need to set the content type to "text/html" on the page that handles the file upload. :-(

    Response.ContentType = "text/html";
    

    If you read the documentation for Ext.data.Connection, you will see that

    The server response is parsed by the browser to create the document for the IFRAME. If the server is using JSON to send the return object, then the Content-Type header must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.

    Took me a while to find this, but as I came across your question, someone else might do to with a similar problem!

    hopefully this will help them!

    0 讨论(0)
提交回复
热议问题