Skip to content

File size limit #53

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

Closed
wes-nz opened this issue Jan 29, 2016 · 5 comments
Closed

File size limit #53

wes-nz opened this issue Jan 29, 2016 · 5 comments

Comments

@wes-nz
Copy link
Contributor

wes-nz commented Jan 29, 2016

Hi,

I have the following error on the server side when I try to save a file.
My files are 300kb top.

Uncaught internal server error. { [Error: request entity too large]
  expected: 285569,
  length: 285569,
  limit: 102400,
  status: 413,
  statusCode: 413,
  message: 'request entity too large',
  type: 'entity.too.large' } Error: request entity too large
    at makeError (/Users/W/Sites/Tracks NZ/Backend/node_modules/parse-server/node_modules/raw-body/index.js:154:15)
    at readStream (/Users/W/Sites/Tracks NZ/Backend/node_modules/parse-server/node_modules/raw-body/index.js:188:15)
    at getRawBody (/Users/W/Sites/Tracks NZ/Backend/node_modules/parse-server/node_modules/raw-body/index.js:95:12)
    at read (/Users/W/Sites/Tracks NZ/Backend/node_modules/parse-server/node_modules/body-parser/lib/read.js:64:3)
    at Object.rawParser [as handle] (/Users/W/Sites/Tracks NZ/Backend/node_modules/parse-server/node_modules/body-parser/lib/types/raw.js:73:5)
    at next_layer (/Users/W/Sites/Tracks NZ/Backend/node_modules/parse-server/node_modules/express/lib/router/route.js:103:13)
    at Route.dispatch (/Users/W/Sites/Tracks NZ/Backend/node_modules/parse-server/node_modules/express/lib/router/route.js:107:5)
    at /Users/W/Sites/Tracks NZ/Backend/node_modules/parse-server/node_modules/express/lib/router/index.js:205:24
    at param (/Users/W/Sites/Tracks NZ/Backend/node_modules/parse-server/node_modules/express/lib/router/index.js:286:14)
    at param (/Users/W/Sites/Tracks NZ/Backend/node_modules/parse-server/node_modules/express/lib/router/index.js:298:16)

I believe it's a middleware issue, I have tried couple of things in my index.js like

var bodyParser = require('body-parser');
api.use(bodyParser.json({limit: '50mb'}));
api.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
api.use(bodyParser.raw({limit: '50mb'}));

Unfortunately no success.

I did jump into the code and found a temporary fix in files.js L:83

router.post('/files/:filename',
            bodyParser.raw({type: '*/*', limit: '5mb'}),
            middlewares.handleParseHeaders,
            processCreate);

Any idea how to override this limit in a clean way?

Thanks

@gfosco
Copy link
Contributor

gfosco commented Jan 29, 2016

Can you submit a PR fixing this with a limit of 20mb?

@wes-nz
Copy link
Contributor Author

wes-nz commented Jan 29, 2016

Sure thing!

@kingmatusevich
Copy link

#54

@gfosco
Copy link
Contributor

gfosco commented Jan 29, 2016

Merged. 👍

@gfosco gfosco closed this as completed Jan 29, 2016
@wes-nz
Copy link
Contributor Author

wes-nz commented Jan 29, 2016

Cool, thanks to the team for their great work 👌

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