forked from pothtonswer/discordmuffin
fix(MultipartBodyWithJSON): form file field name format (#1256)
This commit is contained in:
parent
bb321271cd
commit
1ff58d47ef
1 changed files with 1 additions and 1 deletions
2
util.go
2
util.go
|
@ -51,7 +51,7 @@ func MultipartBodyWithJSON(data interface{}, files []*File) (requestContentType
|
||||||
|
|
||||||
for i, file := range files {
|
for i, file := range files {
|
||||||
h := make(textproto.MIMEHeader)
|
h := make(textproto.MIMEHeader)
|
||||||
h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="file%d"; filename="%s"`, i, quoteEscaper.Replace(file.Name)))
|
h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="files[%d]"; filename="%s"`, i, quoteEscaper.Replace(file.Name)))
|
||||||
contentType := file.ContentType
|
contentType := file.ContentType
|
||||||
if contentType == "" {
|
if contentType == "" {
|
||||||
contentType = "application/octet-stream"
|
contentType = "application/octet-stream"
|
||||||
|
|
Loading…
Reference in a new issue