Set filename for right-click & save-as behavior
This commit is contained in:
parent
bb2ce292ed
commit
62c0b9213b
|
@ -11,6 +11,13 @@ sub by_id($self) {
|
|||
$self->stash(status => 404, error => 'Remark not found 🤷')
|
||||
unless keys %{$remark};
|
||||
|
||||
# Set filename for right-click & save-as behavior
|
||||
if ($self->stash('format') eq 'txt') {
|
||||
$self->res->headers->content_disposition(
|
||||
"inline; filename=remark_${remark_id}.txt"
|
||||
)
|
||||
}
|
||||
|
||||
$self->render;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,13 @@ sub by_id($self) {
|
|||
$self->stash(status => 404, error => 'Page not found 🕵️')
|
||||
unless scalar @{$remarks} || $this_page == $last_page;
|
||||
|
||||
# Set filename for right-click & save-as behavior
|
||||
if ($self->stash('format') eq 'txt') {
|
||||
$self->res->headers->content_disposition(
|
||||
"inline; filename=thread_${thread_id}.txt"
|
||||
)
|
||||
}
|
||||
|
||||
$self->render;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue