[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Append fields before files in FormData of request #20

Merged
merged 1 commit into from
Oct 3, 2017

Conversation

edongashi
Copy link
Contributor

Addresses issues expressjs/multer#322, expressjs/multer#146. which can cause headaches in asynchronous request handling.


As you can see in your request payload, the file is sent before the classId field, and thus there is no way for multer to know about classId when it's handling the file.

I wish I had an easy solution for you but the only thing I can recommend is to manually reorder the fields with javascript to make sure that fields are sent before files.


Thats how your browser works, it's impossible to fix in multer.

A fix for this is to use javascript on the client side to catch the submit event and instead submit using FormData and ordering the fields so that the input data is before any files.

@zackify
Copy link
Contributor
zackify commented Oct 3, 2017

That’s really annoying but I understand the problem. Will make a release in a bit

@zackify zackify merged commit 7e92448 into kimmelsg:master Oct 3, 2017
@zackify
Copy link
Contributor
zackify commented Oct 3, 2017

Install 3.0.9 :) thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants