rename - WeOnlyDo Discussion board

rename (wodSFTP / wodSFTP.NET / wodSFTPdll)

by ssteam, Monday, October 16, 2006, 15:10 (6613 days ago)

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

by wodDrazen, Monday, October 16, 2006, 15:54 (6613 days ago) @ ssteam

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

by ssteam, Tuesday, October 17, 2006, 05:10 (6613 days ago) @ wodDrazen

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 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