in reply to could not open a physical file using href

Given your meek description of the error ("I could not open"), it's hard to know what the problem is.
  • Comment on Re: could not open a physical file using href

Replies are listed 'Best First'.
Re^2: could not open a physical file using href
by shan_emails (Beadle) on Sep 21, 2009 at 15:18 UTC
    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.

      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.