Uploading file error: Request entity too large

I’m using parse-server on my computer (windows10), when I try to upload a zip file (50Mb) via parse-dashboard, It gives me an error:
On dashboard: Request entity too large
In the log: “code”:130,“level”:“error”,“message”:“Invalid file upload.”

I tried FSAdapter too, but still not working.

You are probably hitting the limit of the Express.js body parser body limit. Take a look at this thread: javascript - Error: request entity too large - Stack Overflow

Thank you davimacedo, but it didn’t work for me.

According to maxUploadSize, I add maxUploadSize = '200mb' to configuration option.

But it’s just working for files that have less than about 80mb size, For more than that it gives me an error:
XMLHttpRequest failed: “Unable to connect to the parse API”

You were receiving “Request entity too large” and you are now receiving “Unable to connect to the parse API”, right? So it looks that now you have a different problem. Maybe your parse server process is hitting some limit. How are you running parse server?

Yes, that’s right.
I’m using pm2 with the same index.js in “parse-server-example” (with a little changes).

Isn’t because of http? http doesn’t have any limitation for uploading?

Can you check pm2 logs?

(node:12584) DeprecationWarning: Listening to events on the Db class has been deprecated and will be removed in the next major version.

(Use node --trace-deprecation ... to show where the warning was created)

-me: The number changes every time. (It’s not always 12584)

Oh ok. I had an issue where pm2 would watch the logs folder and server would trigger a restart whenever a file was saved (as saving files would write to logs), so the “unable to connect” error would show

After --trace-deprecation:

at …\node_modules\parse-server\lib\Adapters\Storage\Mongo\MongoStorageAdapter.js:182:16
at processTicksAndRejections (internal/process/task_queues.js:95:5)

<--- Last few GCs --->

[124:03D49218]    80198 ms: Mark-sweep 34.8 (41.6) -> 34.7 (41.6) MB, 2.2 / 0.0 ms  (+ 0.1 ms in 2 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 34 ms) (average mu = 0.995, current mu = 0.970) finalize incremental mark[124:03D49218]    80387 ms: Mark-sweep 152.1 (158.9) -> 152.0 (159.2) MB, 2.7 / 0.0 ms  (+ 2.5 ms in 2 steps since start of marking, biggest step 2.5 ms, walltime since start of marking 183 ms) (average mu = 0.992, current mu = 0.972) allocation failure I

<--- JS stacktrace --->

FATAL ERROR: NewArray Allocation failed - process out of memory

I wonder why it goes to the “Adapters\Storage\Mongo\MongoStorageAdapter.js” !? I just set filesAdapter = fsAdapter, so it supposes to store the file in local storage not MongoDB! (and it does store them to parse/files actually)