Option to read fields first
See original GitHub issueSorry to re-open an old one – but as mentioned in #43, there’s an issue when you want to process the fields of a form before you handle the file stream. Basically if the file field appears first in the upload form, you can’t read the fields until you resume()
the stream.
Now let’s say I want to have a form like so:
<input type="file" name='backupFile' accept=".tar"> Restore Backup
<label>
<input type="checkbox" value="drop" name="drop" checked='checked'>
Drop Existing Data?
</label>
AFAIK there’s no way currently to know whether I need to drop data before I pipe it to the restore handler; I’d need to move the checkbox above the file.
I prose a readFieldsFirst
option to get around this.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Customizing the behavior of cached fields - Apollo GraphQL
Every read function is passed two parameters: The first parameter is the field's currently cached value (if one exists).
Read more >Set default values for fields or controls - Microsoft Support
You can set a default value for table fields set to the Text, Memo, Number, Date/Time, Currency, Yes/No, and Hyperlink data types. If...
Read more >Retrieve selected fields from a search | Elasticsearch Guide [8.5]
Use the fields option to extract the values of fields present in the index ... The first, using the doc keyword, will cause...
Read more >PDF form field properties, Adobe Acrobat
The Options tab appears for most form field types but the options available are unique to each type of form field.
Read more >4. Reading Input Files - Effective awk Programming, 4th ...
If you are using gawk , see Reading an Entire File for another option. ... This example prints each record in the file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jsdevtom That doesn’t work because you have to do something with that data (imagine a multi-GB file upload that comes before non-file fields). Typically that would involve buffering in memory or writing to permanent storage somewhere. That’s not the kind of decision
busboy
should be making.It’s easier/more efficient to just re-arrange the fields on the client side.
@mscdex Got it thanks