cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Pizzo (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-200) FileTransfer should support uploading multiple files in one HTTP request
Date Sat, 03 May 2014 01:46:21 GMT

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

Vincent Pizzo edited comment on CB-200 at 5/3/14 1:46 AM:
----------------------------------------------------------

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:

{code}
            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);
{code}


was (Author: vincentjames501):
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)

Mime
View raw message