AdminFile.ReadFromBinaryFile Method

The ReadFromBinaryFile method returns the contents of the specified binary file. The file can contain any type of data, such as a numeric data or a bitmap.

The method returns the appropriate error when the file is not found, or cannot be accessed for reads.

Syntax

AdminFile.ReadFromFile(FileName)

Parameters

FileName
The path and filename to read.

Example

The following example opens the specified file and then uses the Response.BinaryWrite method to download the file to a browser.

Set oFile = Server.CreateObject("Commerce.AdminFiles")
bFileContents = oFile.ReadFromBinaryFile("c:\temp\postcard.jpg")
Response.ContentType = "image/pjpeg"
Response.BinaryWrite bFileContents

© 1997-1998 Microsoft Corporation. All rights reserved.