Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
How To Use the ADODB.Stream Object to Send Binary Files to the Browser through ASP
Article ID: 276488 - View products that this article applies to.
This article was previously published under Q276488
Web developers often need to read binary files from the Web server's file system through Active Server Pages (ASP) and then send the content to the Web browser (for example, to write an Excel file to the browser). Although developers often attempt this with the File System Object (FSO), the FSO is designed to read only ASCII data from the file system and, therefore, does not work.
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:
193998In Microsoft ActiveX Data Objects 2.5, the ADODB.Stream object offers this functionality. When you call ADODB.Stream from ASP and use the intrinsic BinaryWrite method from the ASP Response object, you can send binary data to any type of browser with very little code.
(http://support.microsoft.com/kb/193998/EN-US/ )How To Read and Display Binary Data in ASP
The following steps illustrate how to use this method to write an Excel file to the browser:
For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/248255/EN-US/ )How To Use the ADO Recordset, Record and Stream Objects to Open Documents
Article ID: 276488 - Last Review: July 15, 2004 - Revision: 2.7