Groups
Groups
Sign in
Groups
Groups
Mojolicious
Conversations
About
Send feedback
Help
Delete temporary files after transfer?
25 views
Skip to first unread message
Ilya Skorik (RU)
unread,
Feb 15, 2011, 10:54:53 AM
2/15/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Mojolicious
How to automatically delete the temporary file after sending it to the
user?
Code:
sub sendFile {
...
my $headers = Mojo::Headers->new;
$headers->add("Content-Type", "$mimetype;name=$filename");
$headers->add("Content-Disposition", "attachment;filename=$filename");
$headers->add("Content-Description", $extension);
$c->res->content->headers($headers);
$c->render_static();
}
How to place a call to unlink that file would be deleted after the
transfer to user?
Sebastian Riedel
unread,
Feb 15, 2011, 11:06:56 AM
2/15/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mojol...@googlegroups.com
http://mojolicio.us/perldoc?Mojolicious/Controller#on_finish
--
Sebastian Riedel
http://mojolicio.us
http://blog.kraih.com
http://twitter.com/kraih
Reply all
Reply to author
Forward
0 new messages