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

Be able to upload big file using $upload.http #179

Closed
killfill opened this issue Apr 3, 2014 · 8 comments
Closed

Be able to upload big file using $upload.http #179

killfill opened this issue Apr 3, 2014 · 8 comments
Labels

Comments

@killfill
Copy link

@killfill killfill commented Apr 3, 2014

In reference to issue #88, It would be nice to be able to upload big files (>500MB) using the .http() method.

When i try to upload big files (i.e. 500MB), the browser crashed. I can see FileRead is reading the whole file, when finished, triggers the onload event where $upload.http() is been called. Its crashing there.

Would be nice to ablt to stream the file to the server.

Thanks!!

@keithdmoore
Copy link

@keithdmoore keithdmoore commented Apr 21, 2014

+1 I could really benefit from this added feature as well. Thanks for creating this library and sharing.

@danialfarid
Copy link
Owner

@danialfarid danialfarid commented Apr 22, 2014

for workaround see #88 (comment)

@killfill
Copy link
Author

@killfill killfill commented Jun 9, 2014

Are there more ideas to explor?

Thanks!!

@sorenriise
Copy link

@sorenriise sorenriise commented Jun 11, 2014

I have played around with various files - my browser crashes when the file is over 50 to 100 mb - I would need to do files over 10-20gb - Angular does not support uploads using chunked http so I think the only way that is possible in angular is to use web sockets and then loop over the file and get file reader blobs of about 10mb at a time

@litera
Copy link

@litera litera commented Oct 9, 2014

Maybe those of you who require huge file uploads should rather use flowjs/ng-flow angular plugin that sends files in chunks.

Choose tools that satisfy your requirements, don't change those that don't.

@Dr-Steve
Copy link

@Dr-Steve Dr-Steve commented Jan 15, 2015

I hit this issue too, I could not upload files over about 100MB. My standard use case was 200MB files, so this was naturally frustrating. After a few days of testing different things, I found that it was using filereader https://developer.mozilla.org/en-US/docs/Web/API/FileReader

Apparently filereader crashes in chrome only on files greater than about 100 MB. There were a few old bug reports about it on the goolge lists, but no one seemed to care enough to fix it.

My workaround was to not use filereader but instead directly reference the input DOM element (note that I use that content type because I am using pre-signed urls to amazon S3. You may need a different content type. Same with PUT vs POST):

var myFile = document.getElementById('file_to_upload');

$scope.upload = $upload.http({
method: 'PUT',
url: (your URL here),
data: myFile.files[0],
headers: {'Content-Type': ' '},
transformRequest: []
}).then(function() { ...

Hopefully this helps someone else out there, it took me days to figure out despite it being a relatively simple fix. I thought that the issue was .http not supporting this size files but it was filereader.

@abodacs
Copy link

@abodacs abodacs commented Jan 27, 2015

+1

@danialfarid
Copy link
Owner

@danialfarid danialfarid commented Apr 23, 2015

It is fixed in version 3.3.4

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

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.