0

How to open a file using file:// using asp.net or Jquery. Bewlo is sample code that I tried but could not work.

<input type="button" value="New Window!" onclick="window.open('file://///192.168.1.1/Shared/Summary.pdf', 'mywindow', 'width=400,height=200')">

When I try this but this will open up the blank tab nothing will be open. I have lots of file like this on the server and on the network drive as well those needs to be open like this way.

Is this possible in this way? If any one give some suggestion to achieve this functionality then that would be good.

Tushar Maru
  • 3,347
  • 10
  • 34
  • 53
  • Does `http://192.168.1.1/Shared/Summary.pdf` work? – Marthijn Nov 10 '14 at 12:07
  • No because those files are not on the virtual directory or root path of the website. Those will be any from the file system. But when I tried directly this on browser "file://///192.168.1.1/Shared/Summary.pdf" then it can open. – Tushar Maru Nov 10 '14 at 12:09
  • I've not done it before, but perhaps a modified version of http://stackoverflow.com/a/19124733/1810243 could work. Just get the file on the server and then pass it back to the user instead of having them navigate directly to it. Just need to tweak the first two lines as far as how you find the file. – MikeSmithDev Nov 10 '14 at 13:19

0 Answers0