node-formidable / formidable

The most used, flexible, fast and streaming parser for multipart form data. Supports uploading to serverless environments, AWS S3, Azure, GCP or the filesystem. Used in production.
MIT License
7.04k stars 682 forks source link

Upload dir async #855

Closed GrosSacASac closed 1 year ago

GrosSacASac commented 2 years ago

For some reason parse callback is never called, I did not yet figure out why

Context:

https://github.com/node-formidable/formidable/pull/853

GrosSacASac commented 2 years ago

@wbt and @Akxe have another look, it works now

The thing I forgot initially when moving to async, is I have to await for a directory to be created and then let the actual file that has that directory destination continue

@wbt I would be curious what the code you made looked like

wbt commented 2 years ago

@wbt I would be curious what the code you made looked like

It had client-side recursive iteration that sent several requests to the server, one for each folder creation and file upload. The server side did path validation (including checking for attempts to walk up the directory tree) etc.

GrosSacASac commented 2 years ago

@wbt thanks for sharing

wbt commented 2 years ago

It might be helpful to add some documentation updates with this PR too.

GrosSacASac commented 2 years ago

It might be helpful to add some documentation updates with this PR too.

@wbt Added a note in the readme

Published https://www.npmjs.com/package/@grossacasacs/formidable here so I can test it for a while

GrosSacASac commented 1 year ago

@tommyhtran please help to review this PR

GrosSacASac commented 1 year ago

Thanks for the review, I will add a few more tests then merge

GrosSacASac commented 1 year ago

All the test pass now ;) But they don't even run in github actions ... Published as 3.3.2