Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different requests for files #17

Open
vildhjarta8 opened this issue Feb 19, 2015 · 4 comments
Open

Different requests for files #17

vildhjarta8 opened this issue Feb 19, 2015 · 4 comments

Comments

@vildhjarta8
Copy link

Is it possible to make request for each file? If i set useArray to false then Droplet make one request only for one of the files (not support multiple files) and all.

I think this feature very important and useful

@Wildhoney
Copy link
Owner

useArray will still send only one request with all of the files, but it's the name it gives to the file property as I noticed a discrepency with the way different frameworks handle multiple files. Some frameworks require the [] notation for the files property, whereas other frameworks/libraries don't.

Do you want to make individual requests per each file? I can look into implementing that, as currently it's not supported.

@vildhjarta8
Copy link
Author

Yes, I'm looking for individual requests per each file. It will be great if you will make this feature.

@rodriguezmanu
Copy link

You can do something like that:

scope.uploadFiles = function uploadFiles() {
                    // Reset...
                    $scope.isError = false;

                    var httpRequest   = new $window.XMLHttpRequest(),
                        formData      = new $window.FormData(),
                        queuedFiles   = $scope.filterFiles($scope.FILE_TYPES.VALID),
                        fileProperty  = $scope.options.useArray ? 'file[]' : 'file',
                        requestLength = $scope.getRequestLength(queuedFiles),
                        deferred      = $q.defer();

$angular.forEach(queuedFiles, function forEach(model) {
.....
)};

@rodriguezmanu
Copy link

@kovalevskyartur I've created a pull request to do that, I hope help you. Here #53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants