You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Morgan Allen (JIRA)" <ji...@apache.org> on 2014/07/10 22:35:05 UTC

[jira] [Created] (CB-7120) File incompatible with XHR2 FormData

Morgan Allen created CB-7120:
--------------------------------

             Summary: File incompatible with XHR2 FormData
                 Key: CB-7120
                 URL: https://issues.apache.org/jira/browse/CB-7120
             Project: Apache Cordova
          Issue Type: Bug
          Components: Plugin File
    Affects Versions: 3.5.0
         Environment: Android 4.4.2
            Reporter: Morgan Allen


Scenario.
Using the Camera API to load a File (from FileEntry)
Upload File using angular-file-upload
Which uses FormData to upload via XHR

I haven't had time to boil this down to a test case yet but here is what I have.

{code:title=File Input Request Payload}
------WebKitFormBoundary8InTUnt3DiGk5CgN
Content-Disposition: form-data; name="file"; filename="AngularJS-large.png"
Content-Type: image/png


------WebKitFormBoundary8InTUnt3DiGk5CgN--
{code}

{code:title=Phonegap File Request Payload}
------WebKitFormBoundaryfFYuBlWwlPwVCVzp
Content-Disposition: form-data; name="file"

[object Object]
------WebKitFormBoundaryfFYuBlWwlPwVCVzp--
Response Headersview source
{code}

And inspecting each object shows the Phonegap File is not derived from a Blob as the browser implementation is.

{code:title=FormData.append API}
void append(DOMString name, File value, optional DOMString filename);
void append(DOMString name, Blob value, optional DOMString filename);
void append(DOMString name, DOMString value);
{code}

Maybe this is causing a serialization issue?



--
This message was sent by Atlassian JIRA
(v6.2#6252)