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

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

Pascal
procedure Put(
    const ASourceFile: string; 
    const ADestFile: string = ''
); overload;
Parameters 
Description 
ASourceFile 
Local file path and name to store on the remote FSP host.
 
ADestFile 
Relative path and file name where the file will be stored on the remote FSP host. 

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

ASourceFile indicates the name of the file on the local file system, and may include drive and directory information in the file name. 

ADestFile is the name of file to use when storing the content on the remote FSP host, and may include a relative path in the file name specification. 

When ADestFile is omitted (or contains an empty string), the file name without drive or directory information is used as the value for ADestFile. To store a file using a specific relative path, the value in ADestFile must be passed as an explicit argument. 

Put creates a TReadFileNonExclusiveStream instance using the value in ASourceFile that reads the file content on the local file system. Put calls the overloaded method using the stream instance and the file modification timestamp (expressed in the GMT timezone) to store the file on the remote FSP host. The TReadFileNonExclusiveStream instance is freed prior to exiting frm the method. 

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.