Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-files
Commits
883a000d
Unverified
Commit
883a000d
authored
Mar 20, 2019
by
Steven Allen
Committed by
GitHub
Mar 20, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14 from ipfs/fix/content-disposition-header
fix the content disposition header
parents
98673cc5
cff97fc4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
multifilereader.go
multifilereader.go
+6
-1
No files found.
multifilereader.go
View file @
883a000d
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment