Skip to content

How can I process a file only if criteria are met in a nodejs express like middleware style? #900

Answered by GrosSacASac
bottom-up-ai asked this question in Q&A
Discussion options

You must be logged in to vote

There are conflicts in your requests: It is impossible to get all the metadata and also not store anything temporarily.

Formidable is stream focused, so you can only know the file size as the file stream finishes,
if you don't want to upload as it is streaming in you have to store it or else the stream is lost.

Also in the stream fields and files are not ordered.

Imagine getting something https://github.com/node-formidable/formidable/blob/493ec88520c960d0d848d55a929630fde62f2aae/test/fixture/http/encoding/menu_separator.png.http
but times 5, and it is coming character by character

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@bottom-up-ai
Comment options

@GrosSacASac
Comment options

@bottom-up-ai
Comment options

Answer selected by bottom-up-ai
Comment options

wbt
Nov 1, 2022
Collaborator

You must be logged in to vote
3 replies
@bottom-up-ai
Comment options

@wbt
Comment options

wbt Nov 4, 2022
Collaborator

@bottom-up-ai
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants