简体   繁体   中英

Open file in different drive from the one where the server script runs

I am developing a Perl program, and I have to produce a .csv file containing the data obtained from an executed query. My program works well, and it produces the .csv file correctly and into the path I want, which is D:\\\\Tabelle\\name_of_the_csv_file.csv . My inetpub folder is inside the C:\\\\ drive, so the program.

The problem is, I generate an HTML page containing a button with the "onclick" property set to window.open( D:\\\\Tabelle\\name_of_the_csv_file.csv ), in order to allow the user to download the file if he wants, but when I click on it, it just opens a blank page, without anything inside it. Here's the HTML part of my page where I have the button:

     <form action='' method=get>
         <table align="center">
           <tr>
                <td align="center" colspan=3>
                       <input align="middle" type=button name="csvObtain" value="Esporta tabella in .csv" onclick="window.open('d:\tabelle\Tabella-2012-8-8-12.11.30.csv')">
                </td>

           </tr>
         </table>
    </form>

Could someone help me resolving this? Do I have to create a different JavaScript?

using window.open like this ,

   window.open(D:\Tabelle\name_of_the_csv_file.csv)

it shall refer to the path on client machine, since the path is in javascript. if you want the file to be available as downloadable item, just map the D\\tabelle folder as child directory(virtual dir) in your application and use relative path for the file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM