Skip to content

lost character '/' when set filename string to formdata #570

@Jake001

Description

@Jake001

Enviroment:
server,not browser;
nodejs@12.22,
"axios": "^1.7.7",
"form-data": "^4.0.0",

code:

var form = new FormData();
form.append( '/firmware.binS', , file.size );
form.append( 'myfile[]', fs.createReadStream('/firmware.bin'), '/firmware.bin' );
const config = {
  headers:{
    'Content-Type':'multipart/form-data',
  },
}
axios.post(url,form,config)
.then((r)=>{
})
.catch((error)=>{
})

problem:
the 1st '/firmwarebinS' is right, the 2nd '/firmware.bin' had been changed to 'firmware.bin'. The '/' is lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions