"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > How to Open Local Folders Using Links?

How to Open Local Folders Using Links?

Published on 2024-11-08
Browse:764

How to Open Local Folders Using Links?

Opening Local Folders via Links

Many attempts have been made to open local folders via links, such as:

However, none of these options has proven successful across all browsers.

Solution: Launching a Downloadable Link

To bypass security restrictions and enable cross-browser compatibility, a downloadable link approach is recommended. Specifically, we can create a .URL or .LNK file and provide a link to it.

.URL File (Recommended):

  1. Ensure that .URL is added as an acceptable MIME type in your web server.
  2. Create a .URL file with the following format:
[InternetShortcut]
URL=file:///D:/
  1. Link to the .URL file from your HTML:

Browser-Dependent Behavior:

  • Chrome: Downloads the .URL file and opens it.
  • Firefox: Downloads the .URL file and opens it.
  • Internet Explorer: Opens the directory directly (no need to save the shortcut).
Release Statement This article is reprinted at: 1729564336 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3