Name

Stream.LoadFromFile Method — (Versions 2.5, 2.6)

Synopsis

stream.LoadFromFile FileName
                  

The LoadFromFile method loads a file contents into an already open Stream object.

Arguments

FileName (String)

Must contain a name of a valid file to be loaded into the currently opened Stream object. If the file specified by this argument cannot be found, a runtime error occurs.

Description

The LoadFromFile method works only with an already opened Stream object, replacing the contents of the object with the contents of the file specified within the LoadFromFile argument, FileName. All pre-existing data is overwritten, and any extra data is truncated. However, the Stream object does not lose its relationship to the resource with which it was originally opened.

The LoadFromFile method can be used to upload a file to a server from a client.

Get ADO: ActiveX Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.