Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Francois Dockes
recoll-webui
Commits
248b293d
Commit
248b293d
authored
Jul 10, 2013
by
Jean-Francois Dockes
Browse files
Use content-disposition header to set file name for Open/Download
parent
933529b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
views/result.tpl
View file @
248b293d
...
...
@@ -24,7 +24,7 @@
%if hasrclextract:
<div
class=
"search-result-links"
>
<a
href=
"/preview/{
{
number
-
1
}
}?{
{
query_string
}
}"
target=
"_blank"
>
Preview
</a>
<a
href=
"/edit/{
{
number
-
1
}
}?{
{
query_string
}
}"
>
Open
</a>
<a
href=
"/edit/{
{
number
-
1
}
}?{
{
query_string
}
}"
>
Download/
Open
</a>
</div>
%end
<div
class=
"search-result-date"
>
{
{
d
[
'time'
]
}
}
</div>
...
...
webui.py
View file @
248b293d
...
...
@@ -294,6 +294,8 @@ def edit(resnum):
rclq
.
scroll
(
resnum
)
doc
=
rclq
.
fetchone
()
bottle
.
response
.
content_type
=
doc
.
mimetype
bottle
.
response
.
headers
[
'Content-Disposition'
]
=
\
'attachment; filename=%s'
%
doc
.
filename
# If ipath is null, we can just return the file
pathismine
=
False
if
doc
.
ipath
==
''
:
...
...
Write
Preview
Supports
Markdown
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