Internet Direct (Indy)
Home
PreviousUpNext
TIdFSP.Put Method (TIdStream, string, TIdDateTime)

Stores a copy of a file from the local file system on the remote FSP host.

Pascal
procedure Put(
    const ASource: TIdStream; 
    const ADestFile: string; 
    const AGMTTime: TIdDateTime = 0
); overload;
Parameters 
Description 
ASource 
Stream with the contents of a file on the local file system.
 
ADestFile 
Relative path and file name where the file will be stored on the remote FSP host.
 
AGMTTime 
Last modification timestamp in GMT for the file on the local file system. The default value is 0. 

Put is an overloaded method used to store a copy of a file from the local file system on the remote FSP host. 

ASource is a TIdStream descendant with the contents of a file on the local file system. Applications must create a stream instance to pass an as argument when using the stream-based variant of the method. 

ADestFile contains the relative path and file name where the file will be stored on the remote FSP host. 

AGMTTime contains the last modification timestamp in GMT for the file on the local file system. The default value is 0, and indicates that the last modification timestamp is ignored. 

Put constructs FSP protocol packets required for the request using the maximum buffer and preferred payload sizes indicated in the ClientMaxPacketSize and ServerMaxPacketSize properties. Put iteratively calls the SendCmd method using the FSP CC_UP_LOAD command and values read from the stream indicated in ASource until all data in the stream has been sent to the remote host. After passing the content of the file, Put calls SendCmd using the FSP CC_INSTALL command with the values in ADestFile and AGMTTime to make the uploaded file available on the remote FSP host. 

Calling Put can result in an EIdFSPProtException exception being raised if the file specified in ADestFile already exists on the remote FSP host. 

Use Get to retreive a file stored on the remote FSP host.

Exceptions 
Description 
Raised with the contents of the FSP packet response when the file already exists on the remote host. 
Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.