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

Writes the contents of a local file to the IOHandler.

function WriteFile(
    const AFile: String; 
    AEnableTransferFile: Boolean = False
): Int64; virtual;
Parameters 
Description 
AFile 
File name to be sent on the IOHandler connection.
 
AEnableTransferFile 
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.

Exceptions 
Description 
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.