This is a browser issue. It is a security issue so different browsers behave differently. Most will simply not allow a link to a local file (because you normally don't do that in a website). However if the site is localhost some browsers may allow it. It is also probably dependent upon the zone the site is in.
One hack that sometimes works is to convert it to http
and then use the file path. In other browsers you have to mangle the file path. Refer to this older post on some suggestions. Also refer to the official docs and notice that file://
is not a supported schema by default so it is up to the browser to determine any support at all.
The preferred workaround is to have the URL point to your app and have your app connect to the share and send the file directly.