Unverified Commit 883a000d authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #14 from ipfs/fix/content-disposition-header

fix the content disposition header
parents 98673cc5 cff97fc4
......@@ -88,7 +88,12 @@ func (mfr *MultiFileReader) Read(buf []byte) (written int, err error) {
// write the boundary and headers
header := make(textproto.MIMEHeader)
filename := url.QueryEscape(path.Join(path.Join(mfr.path...), entry.Name()))
header.Set("Content-Disposition", fmt.Sprintf("file; filename=\"%s\"", filename))
dispositionPrefix := "attachment"
if mfr.form {
dispositionPrefix = "form-data; name=\"file\""
}
header.Set("Content-Disposition", fmt.Sprintf("%s; filename=\"%s\"", dispositionPrefix, filename))
var contentType string
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment