locked
hyperlink with Network file share path not opening from browser RRS feed

  • Question

  • User-205566416 posted

    I have  a hyperlink in mail body whose href is network file path ex: \\serverName\\path\\file.pdf

    I am sending as 

    var url = "file:/// \\serverName\\path\\file.pdf"

    mail.Body = string.Format("<a href='{0}'>View Image</a>", url);
    mail.IsBodyHtml = true;

    It works fine from outlook on my desktop but when I open mail from browser it does not work. How to resolve this

    Sunday, April 15, 2018 11:37 PM

All replies

  • User475983607 posted

    It is not possible as your browser will not allow access to resources like a file shares.
    Sunday, April 15, 2018 11:48 PM
  • User-205566416 posted

    But it works if I manually open the link from other tab

    Monday, April 16, 2018 12:33 AM
  • User283571144 posted

    Hi OnlineUser,

    According to your description, I couldn't understand your issue clearly.

    As your codes, you have add a hyperlink in the mail body.

    Do you mean you couldn't open the image from hyperlink in the browser?

    If this is your issue, I suggest you could firstly check the hyperlink url.

    Best Regards,

    Brando

    Monday, April 16, 2018 9:04 AM
  • User475983607 posted

    But it works if I manually open the link from other tab

    Correct, it is certainly fine to open a file in the browser directly.

    As you have experienced, the browser will not open a file share when the ink is not from originating URL.  Basically the web browser will not allow a web server to select local resources as it creates a security vulnerability. 

    Monday, April 16, 2018 10:14 AM