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

ignite fileupload unable to upload multiple files in same http request. #199

Closed
JiaLiPassion opened this issue Sep 26, 2017 · 6 comments
Closed

Comments

@JiaLiPassion
Copy link
Contributor

Description

Describe the issue.

I want to upload multiple files within the same XHR request, and I use the sample from here, https://jp.igniteui.com/file-upload/multiple-upload, when I select multiple files, it will still send
two xmlhttp request.

Steps to reproduce

  1. Step 1
    open https://jp.igniteui.com/file-upload/multiple-upload
  2. Step 2
    select two files.
  3. Step 3
    Upload and check Network tab in Chrome developer tools,

Result

I hope there is an option to allow use the same XHRHttpRequest to upload multiple files.
just like in plain javascript, we can do like this.

function uploadFiles(files) {
    var xhr = new XMLHttpRequest();
    var formData = new FormData();
    xhr.onload = successfullyUploaded;
    xhr.open("POST", "http://localhost:3000/upload", true);
    xhr.setRequestHeader('X-Requested-With','XMLHttpRequest');
    for(var file in files) {
        formData.append("uploads", files[file].data);
    }
    xhr.send(formData);
}

Expected result

Attachments

here is a screenshot
2017-09-26 16 54 42

@kdinev
Copy link
Member

kdinev commented Sep 26, 2017

@JiaLiPassion The current behavior is by design, since the single XHR request is limited on the size of data it can send over, thus if two or more large files add up to more than the XHR limit, then all the uploads will fail.

@JiaLiPassion
Copy link
Contributor Author

@kdinev , thank you for your reply, is that possible to add an option to allow to send multiple files in a single XHR request? For example, some requirement need multiple files as the input of a single transaction.

@kdinev
Copy link
Member

kdinev commented Sep 26, 2017

@JiaLiPassion Sure, this can be logged as a feature request. We need to move the issue to the ignite-ui repo though.

@JiaLiPassion
Copy link
Contributor Author

@kdinev , thank you!

@kdinev
Copy link
Member

kdinev commented Sep 27, 2017

@JiaLiPassion I've transferred the issue over: IgniteUI/ignite-ui#1228

@JiaLiPassion
Copy link
Contributor Author

@kdinev, got it, thank you very much!

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

No branches or pull requests

3 participants