in reply to Problem linking a file in CGI script

This is a security feature of your browser. In fact, you will find that your browser will also not open the linked file:// url if you serve it a plain HTML page instead of a Perl script. This is to prevent a malicious website from making you read/modify/open files with a known location on your harddisk (like ~/.ssh/id_dsa).

To make your browser open file:// URLs from HTML pages served from a webserver, you will need to change the security settings of the browser.

Replies are listed 'Best First'.
Re^2: Problem linking a file in CGI script
by Anonymous Monk on Oct 29, 2009 at 17:02 UTC
    Hi,

    Firstly, thanks for taking time to reply.

    I tried changing the security settings in my browser but still i am not able to open the file. Also, changing the setting will not be a feasible solution as this program will be used by many people.

    Is there any other workarounds to display the files in a directory as well as provide a link to them?

      I'm not sure what you're actually trying to do. file:// URLs will only work on your local machine, nowhere else. Maybe if you explain what you're trying to do we can come up with a way to solve your actual problem.

      And for your reference, for example for FireFox, firefox open local file:// url points out the Mozilla Knowledge Base on this topic.

        Hi,

        The scenario is, i am developing a web space wherein users can upload their files to my server and can view them whenever required.

        I succeeded in accomplishing the upload task and i am able to list the files in the directory. But i am not able to add the feature of providing links to the files.

        Does this mean i will not be able to provide the link feature at all?