diff --git a/commands/http/client.go b/commands/http/client.go index 44e32e02a..99a9f131f 100644 --- a/commands/http/client.go +++ b/commands/http/client.go @@ -96,7 +96,6 @@ func (c *client) Send(req cmds.Request) (cmds.Response, error) { // TODO extract string consts? if fileReader != nil { httpReq.Header.Set(contentTypeHeader, "multipart/form-data; boundary="+fileReader.Boundary()) - httpReq.Header.Set(contentDispHeader, "form-data: name=\"files\"") } else { httpReq.Header.Set(contentTypeHeader, applicationOctetStream) } diff --git a/commands/http/multifilereader.go b/commands/http/multifilereader.go index 4a564176a..1df121211 100644 --- a/commands/http/multifilereader.go +++ b/commands/http/multifilereader.go @@ -92,12 +92,7 @@ func (mfr *MultiFileReader) Read(buf []byte) (written int, err error) { // write the boundary and headers header := make(textproto.MIMEHeader) filename := url.QueryEscape(file.FileName()) - if mfr.form { - contentDisposition := fmt.Sprintf("form-data; name=\"file\"; filename=\"%s\"", filename) - header.Set("Content-Disposition", contentDisposition) - } else { - header.Set("Content-Disposition", fmt.Sprintf("file; filename=\"%s\"", filename)) - } + header.Set("Content-Disposition", fmt.Sprintf("file; filename=\"%s\"", filename)) header.Set("Content-Type", contentType)