I am trying to present various files via HTTP. I am using the following code (for excel)
Dim fPath As String
Dim fileExt As String
Dim fName As String
fPath = "c:\test.xls" ' Request.Form("fPath")
Response.Clear()
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("Content-Disposition", "attachment;filename=book1.xls")
Response.WriteFile(fPath, True)
Response.End()
It prompts to save or view the Excel doc. If I say SAVE, then it opens the excel document in excel, however the web page displays
|
Action canceled |
Internet Explorer was unable to link to the Web page you requested. The page might be temporarily unavailable. |
Please try the following:
- Click the Refresh button, or try again later.
- If you have visited this page previously and you want to view what has been stored on your computer, click File, and then click Work Offline.
- For information about offline browsing with Internet Explorer, click the Help menu, and then click Contents and Index.
Internet Explorer |
Is there a way to either show the document in the web page or not have the webpage stay open? Will this work with PDF, DOC, etc?
Thanks
Joe