You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Jason Ginchereau (JIRA)" <ji...@apache.org> on 2015/11/11 00:28:11 UTC

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

    [ https://issues.apache.org/jira/browse/CB-7120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14999581#comment-14999581 ] 

Jason Ginchereau commented on CB-7120:
--------------------------------------

Consider making the file plugin generally compatible with the [W3C File API draft standard](http://www.w3.org/TR/FileAPI/). That would make it work better with other APIs such as XHR2 FormData that can use Files and Blobs.

> 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
>              Labels: Triaged
>
> 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.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org