How can I create a link to a local file on a locally-run web page?

后端 未结 5 922
野性不改
野性不改 2020-11-22 03:15

I\'d like to have an html file that organizes certain files scattered throughout my hard drive. For example, I have two files that I would link to:

  • C:\\P
5条回答
  •  盖世英雄少女心
    2020-11-22 03:47

    If you are running IIS on your PC you can add the directory that you are trying to reach as a Virtual Directory. To do this you right-click on your Site in ISS and press "Add Virtual Directory". Name the virtual folder. Point the virtual folder to your folder location on your local PC. You also have to supply credentials that has privileges to access the specific folder eg. HOSTNAME\username and password. After that you can access the file in the virtual folder as any other file on your site.

    http://sitename.com/virtual_folder_name/filename.fileextension

    By the way, this also works with Chrome that otherwise does not accept the file-protocol file://

    Hope this helps someone :)

提交回复
热议问题