Click to See Complete Forum and Search --> : View file


ABudair
December 28th, 2003, 02:42 AM
Hello every body

How could i view a file from the server. I mean open it without download it.

what ever your reply thx alot.

Abudair..

ZoSoo7
December 29th, 2003, 04:04 PM
You can not do such a thing, since the client will no longer be connected to the server after the html is rendered.

ruca
February 16th, 2005, 04:10 AM
You can do this:
http://support.microsoft.com/defaul...kb;en-us;303475

NOTE: It affects all files with the extension that you want to open directly, from any server.

Sukim
February 18th, 2005, 12:28 AM
IT bacsically depends upon what file you would like to send to the browser.

If its any office document, IE might open automatillay in the browser , and the


http://support.microsoft.com/default.aspx?scid=kb;en-us;303475


applies only in case if you require the IE to open file download dialog instead of showing the file in the same window.


Assuming that the file that you want to open is within the same asp.net application
you can use the following. where strFileURL is the file path of the file you want to display.

Response.WriteFile(Server.MapPath(strFileURL))


Hope it worked.

Thanks