about PutFile - WeOnlyDo Discussion board

about PutFile (General questions)

by syphax, Tuesday, May 29, 2012, 00:01 (4560 days ago)

Hi,

I am new to this. I was maintaining some asp code and I found the following:

set ftpsrv = Server.CreateObject( WeOnlyDo.wodSFTPCom.1 )
ftpsrv.RealPath CStr(temp)
ftpsrv.MakeDir CStr(temp)
ftpsrv.PutFile path

The path above is the local path. temp is remote path.

The above are the main parts that I have questions about. Basically, the script checks a remote path, if it doesn't exist, it will create it. My question is, based on the manual, PutFile requires a local path and remote path, but in the code I have, only local path is defined. I was wondering how does it know where to put the files in the remote folder? Is it because there is a MakeDir before it?

In the manual, it says both localFile and remoteFile are optional. What happens when you only provide one path?

Thank you,
Zig

Re: about PutFile

by woddrazen, Tuesday, May 29, 2012, 00:11 (4560 days ago) @ syphax

Hi Zig,


You can check using RemotePath Property which path is specified for remote path.

Can you maybe try that and let us know how it goes?

More help for RemotePath Property you can find here:
http://www.weonlydo.com/SFTP/Help/wodSFTP-RemotePath.html


Regards,
Drazen

Re: about PutFile

by syphax, Tuesday, May 29, 2012, 00:31 (4560 days ago) @ woddrazen

Thanks for the reply Drazen.

I tried using ftpsrv.RemotePath and ftpsrv.RemotePath.value but I am not getting any results. Is the syntax above incorrect?

Hi Zig,


You can check using RemotePath Property which path is specified for remote path.

Can you maybe try that and let us know how it goes?

More help for RemotePath Property you can find here:
http://www.weonlydo.com/SFTP/Help/wodSFTP-RemotePath.html


Regards,
Drazen

Re: about PutFile

by syphax, Tuesday, May 29, 2012, 01:12 (4560 days ago) @ syphax

Both RemotePath and LocalPath don't seem to be set. I am getting an empty string returned for both.

Is there another way to know where I landed after connect?

Thanks

Re: about PutFile

by woddrazen, Tuesday, May 29, 2012, 12:09 (4559 days ago) @ syphax

Zig,


If there is no value inside RemotePath Property then probably remote path is not set.

In this case PutFile without specifying remote path shouldn't work.

After you are connected to server you can try to check for remote path on this way:
[code]sftp1.RealPath .
MsgBox sftp1.ListItem[/code]


Drazen

Re: about PutFile

by syphax, Wednesday, May 30, 2012, 00:02 (4559 days ago) @ woddrazen

Thank you Drazen. That worked.

I was wondering, is there a similar way to get the local path?

Thanks,
Zig

Re: about PutFile

by wodDamir, Wednesday, May 30, 2012, 08:57 (4558 days ago) @ syphax

Zig,

There is none. However, I'm not really sure what you would actually treat as getting local path since it's your local system you're working with.

You can use standard Windows API's for local files etc.

Regards,
Damba