[This is preliminary documentation and is subject to change.]
When overriden in derived class transfers a file from the normal file system (drive letters or UNC) to the plugin's file system.
Namespace:
Tools.TotalCommanderTAssembly: Tools.TotalCommander (in Tools.TotalCommander.dll) Version: 1.5.2.0
Syntax
| C# |
|---|
[MethodNotSupportedAttribute] public virtual FileSystemExitCode PutFile( string LocalName, ref string RemoteName, CopyFlags CopyFlags ) |
| Visual Basic (Declaration) |
|---|
<MethodNotSupportedAttribute> _ Public Overridable Function PutFile ( _ LocalName As String, _ ByRef RemoteName As String, _ CopyFlags As CopyFlags _ ) As FileSystemExitCode |
| Visual C++ |
|---|
[MethodNotSupportedAttribute] public: virtual FileSystemExitCode PutFile( String^ LocalName, String^% RemoteName, CopyFlags CopyFlags ) |
| J# |
|---|
/** @attribute MethodNotSupportedAttribute */ public FileSystemExitCode PutFile( String LocalName, /** @ref */String RemoteName, CopyFlags CopyFlags ) |
| JScript |
|---|
public function PutFile( LocalName : String, RemoteName : String, CopyFlags : CopyFlags ) : FileSystemExitCode |
Parameters
- LocalName
- Type: System..::.String
Local file name with full path, either with a drive letter or UNC path (\\Server\Share\filename). This file needs to be uploaded to the plugin's file system.
- RemoteName
- Type:
System..::.String
%
Name of the remote file, with full path. The name always starts with a backslash, then the names returned by FindFirst(String, FindData%)/FindNext(Object, FindData%) separated by backslashes. The plugin may change the NAME/EXTENSION of the file (e.g. when file conversion is done), but not the path! Do not assign string longer than MaxPath to this parameter or uncatchable PathTooLongException will be thrown.
- CopyFlags
- Type: Tools.TotalCommanderT..::.CopyFlags
Can be combination of the CopyFlags values.
Return Value
One of the FileSystemExitCode values
Remarks
Total Commander usually calls this function twice, with the following parameters in CopyFlags:
- once with neither Resume nor Overwrite set. If the remote file exists and resume is supported, return ExistsResumeAllowed. If resume isn't allowed, return FileExists
- a second time with Resume or Overwrite, depending on the user's choice. The resume option is only offered to the user if ExistsResumeAllowed was returned by the first call.
- The flags SameCase or DifferentCase are added to CopyFlags when the remote file exists and needs to be overwritten. This is a hint to the plugin to allow optimizations: Depending on the plugin type, it may be very slow to check the server for every single file when uploading.
- If the flag Move is set, the plugin needs to delete the local file after a successful upload.
While copying the file, but at least at the beginning and the end, call ProgressProc to show the copy progress and allow the user to abort the operation.
When most-derived method implementation is marked with MethodNotSupportedAttribute, it means that the most derived plugin implementation does not support operation provided by the method.
| Do not thow any other exceptions. Such exception will be passed to Total Commander which cannot handle it. |
Exceptions
| Exception | Condition |
|---|---|
| System..::.UnauthorizedAccessException | The user does not have required access. ame effect as returning ReadError. |
| System.Security..::.SecurityException | Security error detected. Same effect as returning ReadError. |
| System.IO..::.IOException | An IO error occured. Same effect as returning ReadError. |
| System.IO..::.FileNotFoundException | Source file was not found. Same effect as returning FileNotFound. |
| System.IO..::.DirectoryNotFoundException | Cannot locate parent directory of target file. Same effect as returning WriteError. |
| System..::.InvalidOperationException | Requested operation is not supported (e.g. resume). Same effect as returning NotSupported. |
| System..::.NotSupportedException | The actual implementation is marked with MethodNotSupportedAttribute which means that the plugin doesnot support operation provided by the method. Do not confuse with returning NotSupported - it has completelly different effect. |