Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening up files on a web server using window.open(file:///G:\)

Status
Not open for further replies.

LauraCairns

Programmer
Jul 26, 2004
173
GB
I was wondering if someone could give me some advise on a problem I have. At present i have a web application which displays pdf files in a web browser using javascript and the window.open method and pointing to a web address like window.open(I have been asked to find out if it is possible to do something similar but instead opening a file located on my web server e.g.(G:\psh-4.pdf). I would like to be able to display the file in the web browser using the
window.open method again but this time pointing to the location on my web server. I need to be able to open the file using something like:
window.open(file:///G:\phs-4.pdf).
Does anyone know if this is possible and if so has anyone any examples of where this has been done before? Any explanations about how this works would also be useful as I have to try and explain this.
Thanks in advance for any help anyone can give me.
 
Only if that location is accessible from the client. If it's a location only the server knows about, then it isn't going to work.

ie. if G:\ is a mapped network drive on the client and the server, and they both point to the same network resource, then yes, it will work. Otherwise, it will not.

This will only work in an intranet type environment.

-paul

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Are you sure there is no way of getting access to files on the web server using something like window.open(file:///g:\...). My problem is I need to access such files on a web server on the onclick event of a button called show. Have you any idea how I can do this using something like javascript
 
If it is uploaded to the server can I just use normal addresses.
 
You could upload the file to a virtual directory (has to be set up in IIS, something like - this might be C:\inetpub\ Once the file is uploaded to that virtual directory, you can then use window.open on to display it to users over the internet.

-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top