-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Cannot upload file within FormData #4412
Copy link
Copy link
Closed
Description
Describe the bug
After upgrading from 0.24.0 to 0.25.0 File Form upload breaks.
To Reproduce
Original working on 0.24.0 code.
axios({
method: "post",
url: [serverUrl],
data: formData, // FormData object instance with uploading file field
timeout: 120000
});This code was working previously, but now backend cannot extract file field.
After specifying content type:
axios({
method: "post",
url: [serverUrl],
data: formData, // FormData object instance with uploading file field
timeout: 120000,
headers: {"Content-Type": "multipart/form-data"},
});I got an error on backend "bad content-type header, no multipart boundary"
Expected behavior
Seems like previous version of axios (0.24.0) automatically add correct header and also boundary.
Or was there any breaking change that I didn't notice?
Environment
- Axios Version [0.25.0]
- Node.js Version [16.0.0]
- Additional Library Versions [formidable 2.0.1, React-Native 0.66.4]
Additional context/Screenshots
Not needed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels