You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Bas Bosman (JIRA)" <ji...@apache.org> on 2014/01/30 16:24:10 UTC

[jira] [Updated] (CB-2425) FileUploadOptions options structure not very clean, means you can't have a form field called 'header'

     [ https://issues.apache.org/jira/browse/CB-2425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bas Bosman updated CB-2425:
---------------------------

    Component/s:     (was: CordovaJS)
                     (was: Android)
                     (was: iOS)
                 Plugin File

> FileUploadOptions options structure not very clean, means you can't have a form field called 'header'
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CB-2425
>                 URL: https://issues.apache.org/jira/browse/CB-2425
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Plugin File
>    Affects Versions: 2.4.0
>         Environment: Using FileUpload to post a multi-part form to the server.
>            Reporter: Thomas O'Dell
>            Assignee: Joe Bowser
>            Priority: Minor
>              Labels: features
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> The current design of FileUploadOptions is that the options is an object, whose fields represent the form fields. A special option 'headers' represents the headers to be uploaded.
> The format of the form fields is not compatible with JQuery and thus has to be massaged. As well, the design makes it impossible to have a form field called "headers".
> I propose the following format for the Options object (25 = 2.5.0, i.e. first release to support api change):
> { 'apache-cordova-25-form-fields': [
>      {name: <name>, value: <value>},
>      ...
>   ], // i.e. format returned by JQuery's serializeArray(formObject)
>   'apache-cordova-25-header-fields': [
>       {name: <name>, value: <value>},
>       ...
>   ],
>   'apache-cordova-25-upload-options': [
>       {name: <name>, value: <value>}, // e.g. force chunked mode, set throttle speed
>       ...
>   ],
>   <old-style options and headers>
> }
>       



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)