You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Vincent Pizzo (JIRA)" <ji...@apache.org> on 2014/05/02 16:57:16 UTC

[jira] [Commented] (CB-200) FileTransfer should support uploading multiple files in one HTTP request

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

Vincent Pizzo commented on CB-200:
----------------------------------

I would argue that this is not a trivial issue and is a major limitation of the FileTransfer api.  As for an API proposal this would be simple enough:

            var options = new FileUploadOptions();
            //allow this
            options.files = [{fileKey: "file", fileName: imageURI.substr(imageURI.lastIndexOf('/')+1)}];
            //as well as this
            options.fileKey="file";
            options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
            options.mimeType="image/jpeg";

            var params = {};
            params.value1 = "test";
            params.value2 = "param";

            options.params = params;

            var ft = new FileTransfer();
            ft.upload(imageURI, encodeURI("http://some.server.com/upload.php"), win, fail, options);

> FileTransfer should support uploading multiple files in one HTTP request
> ------------------------------------------------------------------------
>
>                 Key: CB-200
>                 URL: https://issues.apache.org/jira/browse/CB-200
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Plugin File Transfer
>    Affects Versions: 1.3.0
>         Environment: Windows XP, Android, Lenovo ThinkPad
>            Reporter: Matt Accola
>            Assignee: Andrew Grieve
>            Priority: Trivial
>
> FileTransfer only allows one file to be uploaded at a time. Should allow multiple files to be uploaded at once.
> This might be necessary if the server-side service requires all files to be submitted at once to ensure any operations on the files are atomic.
> This question has been asked on the phonegap Google Group, http://groups.google.com/group/phonegap/browse_thread/thread/bdc40098c2954870.
> (Update: Since this requires a UI change for parity, I've added more components and moved it out of 1.7.  This should be added to the Roadmap, so I'm leaving it assigned to myself so I'm reminded to do this - Joe)



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