login about faq

I am using your SFTP (Secure File Transfer over SSH)

Is there a copy function in your software?

After I upload a file I want to copy it to a backup folder. Is there such a function in your SFTP software?

Obviously I can upload twice, but copying would probably be faster. We have heavy upload volume.

asked Oct 19 '15 at 08:19

chilkat's gravatar image

chilkat ♦♦

There is nothing in the SFTP protocol itself to do a remote "cp" command to copy a file from one location on the server to another.

You could use SSH run a "cp" command on the server. For example:

success = ssh.SendReqExec(channelNum,"cp filePath1 filePath2");

See: http://www.example-code.com/csharp/ssh_exec.asp

It should be possible to keep an SSH authenticated connection open for many commands. Each SendReqExec would have to occur on its own logical SSH channel. This means that for each command, one would open a new channel via OpenSessionChannel, send the command, and then receive any output via ChannelReceiveToClose.

Note: The SendReqExec is not a remote shell session. A remote shell session is a bit different, and is demonstrated here: http://www.example-code.com/vb6/ssh_multiple_commands.asp


answered Oct 19 '15 at 08:30

chilkat's gravatar image

chilkat ♦♦

I use this code. It works if I run "ls", but it cannot run "cp", that's why??


answered Jun 29 at 11:38

muggle222's gravatar image


I have the same problem. Maybe it is the config of ssh server?


answered Aug 27 at 13:29

muggle222's gravatar image


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Oct 19 '15 at 08:19

Seen: 573 times

Last updated: Aug 27 at 13:29

powered by OSQA