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

Uploading large files #93

Closed
Kakakirbz opened this issue Sep 15, 2018 · 5 comments
Closed

Uploading large files #93

Kakakirbz opened this issue Sep 15, 2018 · 5 comments

Comments

@Kakakirbz
Copy link

Hello! I am in need of big help. I am working on a module of my thesis that specifically can upload multiple files in one input. I tried uploading videos. I can upload videos that has a size of 20mb but when I tried and upload more than 100mb, it returns an error message. The problem is, I can't seem to upload files that are large.

Here is the error message
image

I hope this issue could be answered ASAP. Thank you ahead!

@randomdipesh
Copy link

exactly same issue here
screenshot from 2018-09-19 08-22-24

@randomdipesh
Copy link

Here is how I fixed it 👍
node_modules>express-fileupload>lib>index.js and removed md5= md5(buf) on line 146
Its working now

@senakafdo
Copy link

A suggestion for the devs would be to replace md5: md5(buf), with md5: function() { return md5(buf); }, such that somebody can then use it as: req.files.foo.md5() - it not only solves this OOM issue but also makes the execution faster.

Also, a slightly better tweak compared to what @randomdipesh suggested would be to include the following in the code:

const mock = require('mock-require');
mock('md5', 'empty/functionThatReturnsArgument');
const upload = mock.reRequire('express-fileupload');

And add the following as dependencies:

    "mock-require": "3.0.2",
    "empty": "0.10.1",

@richardgirges
Copy link
Owner

I'm going to take @senakafdo's advice and update md5 to become a method for execution at will, as opposed to a property that's always available on the file object.

I'll try to get this pushed up in a major release sometime in the next week

@richardgirges
Copy link
Owner

Should be fixed in latest release: v1.0.0-alpha.1

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

4 participants