in reply to Re: Can't get Open Document popup window to appear
in thread Can't get Open Document popup window to appear

Thank you for your response. I'm not certain that this could be the problem, since as I mentioned (briefly in passing), when I save the generated source code into a file (using "View Page Source") and the plug that code into the browser, everything works exactly the way I need it to. It only fails when I am using the generated code from the Perl script, which was created with the PRINT command:

print "<a href=\"file:$filepath$path_ext\">$format</a></TD>\n";

resulting in this line in the HTML code:

<a href="file:/net/server/Docs/02.pdf">pdf</a></TD>

If the browser will not accept following to local file:// URIs, then why would this succeed when it comes from a source code file instead of automatically generated code?

Replies are listed 'Best First'.
Re^3: Can't get Open Document popup window to appear
by Corion (Patriarch) on Sep 23, 2011 at 18:30 UTC

    Where do you save your file? If a page is served over the http protocol, it cannot open file URIs local to the client. If you "save the page" locally and then open it by double-clicking, you open the page as a local file. Local files are allowed to open other local files. Save your page and upload it to your webserver. If the static page works from there, your problem is elsewhere. If the static page fails in the same way your Perl script fails, the error is as I said.

      Thanks again for your response. I rewrote the Perl code to cause it to write the generated HTML code into a file on the webserver (not on the client). I then use the browser to access that file with the Open File... command, and the result works just fine.

      So you wrote "Save your page and upload it to your webserver. If the static page works from there, your problem is elsewhere." I didn't actually upload the file to the webserver, I wrote the file directly onto the webserver's disk. So, doesn't this mean that my "problem is elsewhere"?

      I chose a read/writeable directory on the webserver and generated a unique filename for the file:

      @timedata = localtime(time); $cur_time = join('', @timedata); open (OUTPUT, ">/net/server/other/exec_$cur_time.html");

      Then all my PRINT commands go into OUTPUT. I am still not achieving my goal of directing the user to that HTML page, but I am trying to test the theory of whether I am allowed to access a file on the webserver...

        What do you mean by "Open file" command? Do you enter the http:// URL into the address bar or do you do anything else? Only if your page is served via http:// the situation will be comparable to visiting your page through the website. If you use the "Open File" command, as it happens to display a file picker window, and is often accessed through CTRL+O, then the HTML page will not be served through HTTP and thus be able to access local resources through the filesystem.

        Please make sure that you understand the difference between "filesystem" and "HTTP", and make sure your testcases are comparable.