Topic Path: Symbol Reference > Classes > TIdFSP Class > TIdFSP Methods > Get Method > Get Method (string, TIdStream, Boolean)
ContentsIndexHome
PreviousUpNext
TIdFSP.Get Method (string, TIdStream, Boolean)

Retrieves a file from the remote FSP host.

procedure Get(
    const ASourceFile: string; 
    ADest: TIdStream; 
    AResume: Boolean = false
); overload;
Parameters 
Description 
ASourceFile 
File name on the remote FSP host.
 
ADest 
Stream used to store the contents of the retrieved file.
 
AResume 
The operation can be resumed from its current position. 

Get is an overloaded procedure used to retreive the file specified in ASourceFile from the remote FSP host. 

ADest is a TIdStream descendant used to store the contents of the retrieved file on the local file system. The stream may be a TFileCreateStream instance when file content is overwritten and not resumed. The stream may be a TAppendFileStream instance when file content is not overwritten and resumed from its current position. 

AResume indicates if the retrieval operation can be resumed from its current position in the stream (based on the exisiting contents of the local file in ADestFile). 

When AResume contains True, the current stream position is included in the packet for the FSP request. When AResume contains False, the file position in the packet for the FSP request is set to 0 (zero). 

Get constructs the TIdFSPPacket instance required in the FSP protocol request using the optimal buffer size indicated by the ClientMaxPacketSize and ServerMaxPacketSize properties (including the required 12-byte header). 

Get iteratively calls SendCmd using the packet for the FSP request, and captures the packet from the FSP response. If the FSP response packet contains data for the file, it is written to the stream specified in ADest. The process is repeated until all data is read for the requested file. 

Gets signals the OnWorkBegin, OnWork, and OnWorkEnd event handlers during processing of response packets in the FSP protocol exchange. OnWork is signalled with the number of bytes from an FSP response packet that represent actual data stored in ADest. 

Use OnSend and OnRecv to perform actions required when FSP protocol packets are sent or received. 

Use Put to store a file found on the local file system to a specific path on the remote FSP host.

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