Results 1 to 2 of 2

Thread: [FIXED][2.x] File upload and XML response not work together

  1. #1
    Sencha User
    Join Date
    Sep 2007
    Poland, Cracow
    Vote Rating

    Exclamation [FIXED][2.x] File upload and XML response not work together

    Hello all,
    at the beginning I want to write some background information:

    Background information
    In my application I'm using XML documents to provide communication between server (PHP) and client (JS).
    XML file looks like this one:
    HTML Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <response success="true">
        <log type="Notice" action="GetProfile" msg="Done"/>
          <fullname>Default Admin</fullname>
    Page generation time: 1.708 sec.
    In XML file I'm sending all information from server:
    - data
    - error/message information (logs)
    - security information (no authorization for some action)
    - info about not valid fields
    - etc

    I changed default XmlReader to process my own XML format.
    All works fine.

    Recently I wanted to add image support, so I need to upload some images.
    But there is a problem.

    Problem background
    It is very difficult to debug file upload response, because it is not standard Ajax request.
    In Firebug it is shown on Net tab, but I couldn't see valid response,
    because Firefox doesn't cache XML files.
    I'm using HttpFox also, but results are the same.
    After many hours fighting with debugging I finally found the main problem.
    Fiddler turned out helpful with file upload debugging.

    XML files can be sended with following content types:
    - text/html (no response.responseXML in Firefox)
    - text/xml (works fine)
    - application/xml (works fine)

    In file upload example you used JSON output. It is working fine.
    But the problem is when I want to use XML output here.

    In file upload case, instead of standard AJAX request, there is used method:, ps, url)
    Inside it there is function cb(), which returns following object:
                var r = {  // bogus response object
                    responseText : '',
                    responseXML : null
    The problem is in case of XML file, there is no responseText!

    In abstract class Ext.form.Action there is private function:
        // private
        processResponse : function(response){
            this.response = response;
                return true;
            this.result = this.handleResponse(response);
            return this.result;
    The problem is if there is no response.responseText this function returns true,
    and there is no possible response handling e.g. error processing (with this.form.errorReader)

    I think you should change above function to this:
        processResponse : function(response){
            this.response = response;
            if(!response.responseText &&!response.responseXML){
                return true;
            this.result = this.handleResponse(response);
            return this.result;

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Sydney, Australia
    Vote Rating


    Remember seeing this before. Fixed in SVN.
    Evan Trimboli
    Twitter - @evantrimboli

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts