in reply to Re: could not open a physical file using href
in thread could not open a physical file using href

Hi

the link code is
print $html -> p({}, "<a href=\"D:/test.pdf\">file link</a>");


While i click the link it shows as "Firefox doesn't know how to open this address, because the protocol (d) isn't associated with any program."

Note
But if the file is under the CGI site then it opens.

Thanks
Shanmugam A.

Replies are listed 'Best First'.
Re^3: could not open a physical file using href
by ikegami (Patriarch) on Sep 21, 2009 at 15:27 UTC

    That's not the code you gave us originally.

    Since this is a CGI script, I'm assuming it's output is being fetched using HTTP. (HTTPS is the next most likely candidate. Consider HTTP and HTTPS interchangeable.)

    href takes a URL for value. I've never heard of the "d:" URI/URL scheme either. Your URL is unsupported or malformed.

    • If that's the absolute file system path to a file on the client's computer, you'd use the "file:" scheme (but that makes no sense and some browsers won't let you for security reasons).
    • If that's the absolute file system path to a file on the server's machine, you'll need to construct an "http:" URL.
    • If it's suppose to be a relative URL, then you need to escape the ":".

    Let me know which one it is, and I'll help you further.