Topic Path: Symbol Reference > Classes > TIdIOHandler Class > TIdIOHandler Methods > WriteFile Method
TIdIOHandler.WriteFile Method

Writes the contents of a local file to the IOHandler.

function WriteFile(
    const AFile: String; 
    AEnableTransferFile: Boolean = False
): Int64; virtual;
File name to be sent on the IOHandler connection.
Not used at this time. 

Cardinal - Number of bytes in the file written to the IOHandler.

WriteFile is a virtual Cardinal function used to write the entire contents of local file specified in AFile to the IOHandler. 

When AFile contains an invalid or missing file name, an EIdFileNotFound will be raised. 

WriteFile calls write using a temporary TFileStream created for reading the contents of the file in AFile. 

WriteFile returns the number of bytes found in the file stream written to the IOHandler.

RSFileNotFound and the fully qualified file name. 
Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.