$ mkdir public $ date > public/ex1.txt $ zip public/ex1.zip public/ex1.txt $ ls -l get_link.pl public/ -rw-rw-r-- 1 stefan stefan 240 Feb 20 19:20 get_link.pl -rw-rw-r-- 1 stefan stefan 29 Feb 20 19:21 public/ex1.txt -rw-rw-r-- 1 stefan stefan 207 Feb 20 19:21 public/ex1.zip $ perl get_link.pl get /ex1.txt Hi Tue Feb 20 19:21:04 CST 2018 $ perl get_link.pl get /ex1.zip Hi PK....gibberish....
All seems like it's working as expected to me. It sounds as if the only situation it doesn't print Hi is when you click the link. Can you hover over that link and make sure the link is what you're expecting? Are you getting a 404 from Mojolicious? Or what are you getting with the route /ex1.zip? I also ran this as a daemon and loaded it in my browser and when I clicked the link for Exemple 1 Hi appeared in my STDOUT. On Tue, Feb 20, 2018 at 1:17 PM, <[email protected]> wrote: > Look please this : > > get_link.pl : > -------------------------------------------------------------- > #!/usr/bin/env perl > use Mojolicious::Lite; > > app->hook(before_dispatch => sub { > my $c = shift; > print "Hi\n"; > }); > get '/page' => sub { my $c = shift ; $c->render }; > > app->start; > > __DATA__ > @@ page.html.ep > <a href="/ex1.zip">Exemple 1</a> > -------------------------------------------------------------- > > - that print Hi when I load "page" > - print Hi when I do : perl get_link.pl get /ex1.zip > - do NOT print Hi when I click my link "Exemple 1" > - but print Hi if I write <a href="/ex1.txt"> : txt file and not more > zip... That displays the content of the text file in the browser and print > Hi. > > Impossible to do that with a zip file... Do please someone have an idea ? > > NB : ex1.zip and ex1.txt files are in .../public/ > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
