Xipan Xiao created SHINDIG-1761:
-----------------------------------

             Summary: IE: fail to process file upload response with special 
characters (")
                 Key: SHINDIG-1761
                 URL: https://issues.apache.org/jira/browse/SHINDIG-1761
             Project: Shindig
          Issue Type: Bug
          Components: Java
    Affects Versions: 2.0.2
         Environment: IE
            Reporter: Xipan Xiao


The server responds the following HTML content when uploading a file. Inside 
the <textarea> element, there is a JSON object. It is a valid JSON string, 
however, when this arrives the client side in an iframe, the JSON string 
extracted from the <textarea> element is decoded, thus all (&quot;) are 
converted to (") and that breaks the string. See the following code:

var txt = iframe.document.getElementsByTagName("textarea")[0].value;//this txt 
is an invalid JSON string.

For browsers like Firefox that has the window.FormData object, we're using AJAX 
to upload files and sever reponses are processed directly, without putting into 
an iframe/textarea element. For IE we can't avoid putting the response into an 
iframe.

The HTML response that causes the problem:

<html><head></head><body><textarea>{"http://example.com/upload":{"rc":200,"body":"{&quot;errorCode&quot;:&quot;InvalidRequest&quot;,&quot;errorMessage&quot;:&quot;An
 error occurred while handling reading the API request.  The request cannot be 
completed.&quot;}"}}</textarea></body></html>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to