To read binary data from the file system, you must use a component that has the ability to read binary data. For additional information about to create your own component, click the article number below to view the article in the Microsoft Knowledge Base:
- Create a new ASP page, and paste the following code:
'Set the content type to the specific type that you are sending.
Response.ContentType = "application/x-msexcel"
Const adTypeBinary = 1
strFilePath = "C:\ExcelFiles\Excel1.xls" 'This is the path to the file on disk.
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = adTypeBinary
Set objStream = Nothing
- Save the file to the Web server.
- In the browser, browse to the file.
Article ID: 276488 - Last Review: Sep 22, 2009 - Revision: 1