[Catalyst] Link to file

Chisel Wright chisel at herlpacker.co.uk
Thu May 24 17:02:34 GMT 2007


On Thu, May 24, 2007 at 08:43:52AM -0700, Will Smith wrote:
>    the error is : File Not Found.
>    Yes, I have apache, and also tried on dev machine at localhost. Problem is
>    when adding the file path to template, like: <a href="[% myvar
>    %]">listen</a>, and myvar = '/var/www/html/myfolder/myfile.wav';
>    when move the cursor over  "listen" the link is :
>    http://localhost:3000/var/www/html/myfolder/myfile.wav  or
>    http://www.mydomain.com/var/www/html/myfolder/myfile.wav
> 
>    Obviously, this is the wrong path to the file. How can I drop the
>    http://... before the real path?

I have a nasty feeling you're trying to do something a very bizarre and
bad way, but on the basis that you seem to want to link to a file on
your local file system:

how about either using <a href="file://[% myvar %]">listen</a> or
having file:// already in myvar.

However, the fact that file:// (or dropping http://) seems to be in your
solution anywhere at all is really setting alarm bells ringing.

-- 
Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/

  Screenie or it didn't happen.



More information about the Catalyst mailing list