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

How to upload file?? #171

Closed
devalexqt opened this issue Jul 23, 2022 · 1 comment
Closed

How to upload file?? #171

devalexqt opened this issue Jul 23, 2022 · 1 comment

Comments

@devalexqt
Copy link

How to upload big file 1G ?

@cmorten
Copy link
Owner

cmorten commented Aug 27, 2022

Opine doesn't provide out of the box behaviours for large files, you will need to either write custom code to consume the request yourself or use a third party middleware for processing.

Refer to docs on req.body --> https://github.com/cmorten/opine/blob/main/.github/API/request.md#reqbody

As the body is large, would not recommend reading it all into memory as the example suggests, but instead in chunks (potentially writing to disk) using something like multipart/form-data.

If looking to write your own, recommend checking out how it is done in Oak --> https://github.com/oakserver/oak/blob/main/multipart.ts

@cmorten cmorten closed this as completed Aug 27, 2022
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

2 participants