rename (wodSFTP / wodSFTP.NET / wodSFTPdll)
I have a rename problem ..
when login user-id OK , after put file , then I change filename with Rename Function , but it have a error ...
(1) when user login , Home_diractory = / , Rename Function is OK ...
(2) when user login , Home_diractory = /home/act , Rename Function is not OK ,
I understand this error is what , i can how to modify the error ..
Source Code :
ftp.login = aaa
ftp.password = 123
ftp.port = 21
ftp.connect
msgbox ftp.RemotePath (/home/act)
ftp.PutFile( aa.txt ,ftp.RemotePath)
ftp.Rename(ftp.RemotePath & bb.txt ,ftp.RemotePath & aa.txt )
then it happen a error ...
Re: rename
Hi ,
Probably RemotePath Property changed from /home/act after you call PutFile Method to /home/act/aa.txt and your code isn't working.
You can try on this way:
-------------------------------------------------------
Set dlx1 = New wodFtpDLXCom
Dim a As String
dlx1.HostName = your_server_name
dlx1.Login = your_login
dlx1.Password = your_password
dlx1.Blocking = True
dlx1.Connect
a = dlx1.RemotePath
dlx1.PutFile c:\aa.txt , a & /aa.txt
dlx1.Rename a & /bb.txt , a & /aa.txt
-------------------------------------------------------
Or you can try to use full path, without using RemotePath Property:
-------------------------------------------------------
Set dlx1 = New wodFtpDLXCom
dlx1.HostName = your_server_name
dlx1.Login = your_login
dlx1.Password = your_password
dlx1.Blocking = True
dlx1.Connect
dlx1.PutFile c:\aa.txt , /home/act/aa.txt
dlx1.Rename /home/act/bb.txt , /home/act/aa.txt
-------------------------------------------------------
More help for RemotePath Property you can find here:
http://www.weonlydo.com/FtpDLX/Help/wodFtpDLXLib~wodFtpDLX~RemotePath.html
Let us know how it goes.
Regards,
Drazen
Re: rename
Thanks !! I testing OK ..
Hi ,
Probably RemotePath Property changed from /home/act after you call PutFile Method to /home/act/aa.txt and your code isn't working.You can try on this way:
-------------------------------------------------------
Set dlx1 = New wodFtpDLXCom
Dim a As Stringdlx1.HostName = your_server_name
dlx1.Login = your_login
dlx1.Password = your_password
dlx1.Blocking = True
dlx1.Connecta = dlx1.RemotePath
dlx1.PutFile c:\aa.txt , a & /aa.txt
dlx1.Rename a & /bb.txt , a & /aa.txt
-------------------------------------------------------Or you can try to use full path, without using RemotePath Property:
-------------------------------------------------------
Set dlx1 = New wodFtpDLXComdlx1.HostName = your_server_name
dlx1.Login = your_login
dlx1.Password = your_password
dlx1.Blocking = True
dlx1.Connectdlx1.PutFile c:\aa.txt , /home/act/aa.txt
dlx1.Rename /home/act/bb.txt , /home/act/aa.txt
-------------------------------------------------------More help for RemotePath Property you can find here:
http://www.weonlydo.com/FtpDLX/Help/wodFtpDLXLib~wodFtpDLX~RemotePath.htmlLet us know how it goes.
Regards,
Drazen