You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am creating formdata like below : Server requires form-data as : name=file ; filename=
The value of name is expected to "file" on sever and filename is the actual filename
Using the current mutipart I can only generate something like :
1> Content-Disposition;form-data; name=file ; filename=file
2> Content-Disposition;form-data; name=a.txt ; filename=a.txt
Cannot get something like :
3>Content-Disposition;form-data; name=file ; filename=a.txt
It seems that when I pass "Name" in Formfile the fieldname also switches to "Name" .
It seems in the file :plugins/multipart/multipart.go (in function writeFile this change happens before passing these values to multipartWriter.CreateFormFile(fileName, file.Name)).
The text was updated successfully, but these errors were encountered:
I am creating formdata like below : Server requires form-data as : name=file ; filename=
The value of name is expected to "file" on sever and filename is the actual filename
Using the current mutipart I can only generate something like :
1> Content-Disposition;form-data; name=file ; filename=file
2> Content-Disposition;form-data; name=a.txt ; filename=a.txt
Cannot get something like :
3>Content-Disposition;form-data; name=file ; filename=a.txt
------WebKitFormBoundaryePkpFF7tjBAqx29L
Content-Disposition: form-data; name="file"; filename="a.txt"
Content-Type: application/octet**
... contents of file goes here ...
------WebKitFormBoundaryePkpFF7tjBAqx29L--
Here is the snippet I use and then pass it to gentelman's client.Use(multipart.Data(dt))
fields := map[string]common.Values{"attachment": {"SomeValue"}}
dt := common.FormData{
Data: fields,
Files: []common.FormFile{{Name: , Reader: r}},
}
It seems that when I pass "Name" in Formfile the fieldname also switches to "Name" .
It seems in the file :plugins/multipart/multipart.go (in function writeFile this change happens before passing these values to multipartWriter.CreateFormFile(fileName, file.Name)).
The text was updated successfully, but these errors were encountered: