Back to product page

SmartPut property


Determines if wodFtpDLX.NET should try to determine remote filename on PutFile command.

Type

Boolean

Syntax

  • C#
  • VB.NET
Boolean SmartPut {get; set; };

Property SmartPut As Boolean

Remarks

wodFtpDLX.NET tries to be smart when you call PutFile method. It tries to determine which filename are you trying to upload, by querying remote server if supplied RemotePath in PutFile call is a directory, in which case name is specified as last part of LocalPath argument of PutFile call. This is a nice thing - it allows you specify whatever you wish in LocalPath and RemotePath arguments, but usually causes wodFtpDLX.NET to send one additional CWD before uploading file on the server. Some administrators and users prefer not to see that command in logs.

In such cases you can set SmartPut to False, in which case wodFtpDLX.NET will assume you have specified full paths in both LocalPath and RemotePath arguments in PutFile call. If you specify only folder(s), PutFile will fail.

As example, you can look at this PutFile call:

PutFile("c:\somefolder\a", "/somewhere/b")

If 'a' is a file - what is your intention? Do you want to store this file to remote server as file named 'b' or you want to store it as file 'a' in remote folder 'b'? wodFtpDLX cannot know this so he tests for existance of "/somewhere/b". If such folder is found, file is saved as "/somewhere/b/a". If such folder is not found, file is saved as "/somewhere/b" . When SmartPut is set to False, error will be generated if "/somewhere/b" is a folder.

Platforms

Windows