'How can I link to an Excel file on a network share from a php web page?

I am trying to link a file on a php webpage which is hosted on a server within our local network using IIS.

The workbook must load via the network location and not download a copy. All users have been given permission to access the workbook.

I have tried <a href='file:\\myserver\workbook.xlsm'>Open Workbook</a> but it gets blocked by the browser. (Edge Chromium is the default in our organisation.)

I have tried a batch file (that opens the workbook) in the root of the web directory and then doing <a href='file.bat'> etc. but I get a server error page to say the resource was not found. I had the same issue trying to put it in a zip archive.

(If I change the extension to .txt it will load, and open in the browser, so clearly .bat is blocked, and .zip ?)

I could have a button that copies the filepath to the clipboard and then pops up a modal that asks the user to press Windows key + R and paste the link and press enter. I don't think that's acceptable UX though.

The only other idea I have is to make the link trigger an email to the user with the network link to the excel file contained (we have AD so I know the user's email address on page load.) Again, this is not a good UX.

Does anyone have any better ideas to achieve a link that will open a file from a local network share?

(Oh I have even tried a .lnk file which the user could download and open and its target was set to the file on the network path. But .lnk was blocked like .bat)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source