I might be off base, but I'm wondering if what you're looking for is how to
serve static files from a non default location?

http://mojolicious.org/perldoc/Mojolicious#static


On Thu, Apr 5, 2018, 2:19 PM Caveman Pl <caveman...@gmail.com> wrote:

> Hi Dan,
>
> Changing
>
> $r->post('/showqcshowimg')->to('Pdataexport#showQCshowIMG');
>
> to
>
> $r->get('/showqcshowimg')->to('Pdataexport#showQCshowIMG');
>
> doesn't help.
>
> Thank you,
> tj
>
>
> W dniu czwartek, 5 kwietnia 2018 20:34:07 UTC+2 użytkownik Dan Book
> napisał:
>
>> Sorry, your issue is in routing: your showimg route is POST-only, but
>> browsers will always use GET to request an image.
>>
>> On Thu, Apr 5, 2018 at 2:32 PM, Dan Book <gri...@gmail.com> wrote:
>>
>>> Try this:
>>> https://metacpan.org/pod/Mojolicious::Guides::Rendering#Custom-responses
>>>
>>> On Thu, Apr 5, 2018 at 2:26 PM, Caveman Pl <cavem...@gmail.com> wrote:
>>>
>>>> Hi group,
>>>>
>>>> I have no idea how to export images located outside of public directory.
>>>> Forgive me to disturbing groups such a lame questions but cant find
>>>> working example with google...
>>>>
>>>> I have a route
>>>>
>>>> $r->get('/pdataexport_qc')->to('Pdataexport#showQC');
>>>> $r->post('/showqcshowimg')->to('Pdataexport#showQCshowIMG');
>>>>
>>>> in my Pdataexport.pm
>>>>
>>>> sub showQC{
>>>>     my $self = shift;
>>>>     my $pDataPath = $self->config('phenotypeDataFromResoraDbFilesPath');
>>>>     my $dir = $self->param('dir');
>>>>     $self->stash( dirToQC => $dir);
>>>>     $self->render('phenotypeExport/showDataQC');
>>>> }
>>>>
>>>> my template phenotypeExport/showDataQC.html.ep
>>>>
>>>>
>>>> % layout 'all';
>>>> <table border="0" style="border-collapse: collapse;">
>>>> <tr><td><img src="https://192.168.11.11:1777/showqcshowimg?dir=
>>>> <%=$dirToQC%>&img=AH1vsAGE.png"></td></tr>
>>>> </table>
>>>> </body>
>>>> </html>
>>>>
>>>> which generates me nice url
>>>> <table border="0" style="border-collapse: collapse;">
>>>> <tr><td><img src="https://
>>>> 192.168.11.11:1777/showqcshowimg?dir=2018-04-03-18-32-46_G&img=AH1vsAGE.png
>>>> ">
>>>> </table>
>>>> </table>
>>>>
>>>>
>>>> but in log output I can see that was not routed to showqcshowimg
>>>> sub showQCshowIMG {
>>>>     my $self = shift;
>>>>     my $img = $self->param('img');
>>>>     my $dir = $self->param('dir');
>>>>     my $pDataPath = $self->config('phenotypeDataFromResoraDbFilesPath');
>>>>     $self->render_file(filepath => $pDataPath.$dir."/".$img, 'filename'
>>>> => $img );
>>>> }
>>>>
>>>> Can you give a simpe example how it should be done?
>>>> or maybe you know page or open project which can play as example?
>>>>
>>>> Thank you,
>>>> tj
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> 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 mojolicious...@googlegroups.com.
>>>> To post to this group, send email to mojol...@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/mojolicious.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>> --
> 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 mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to