Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit 1ff58d4

Browse files
authored
fix(MultipartBodyWithJSON): form file field name format (bwmarrin#1256)
1 parent bb32127 commit 1ff58d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func MultipartBodyWithJSON(data interface{}, files []*File) (requestContentType
5151

5252
for i, file := range files {
5353
h := make(textproto.MIMEHeader)
54-
h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="file%d"; filename="%s"`, i, quoteEscaper.Replace(file.Name)))
54+
h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="files[%d]"; filename="%s"`, i, quoteEscaper.Replace(file.Name)))
5555
contentType := file.ContentType
5656
if contentType == "" {
5757
contentType = "application/octet-stream"

0 commit comments

Comments
 (0)