Send one particular file to SFTP

I recently changed from ftp to sftp. Now I cannot ftp from my text editor anymore.
Especially deleting the the content of the log file, save and ftp doesn't work anymore.

So now I thought: I make a button to copy an empty log file to the sftp site:

Copy FILE="D:\my_empty.log" TO=@Log_ftp_address_book_account

It doesn't seem to work. Can anybody help me?

And I allways want to overwrite the file at the ftp site.

That looks correct. If there are any spaces in the FTP name then it will need to be put in quotes like the filename is.

When you click the button, does anything appear in the FTP log? (Tools -> Output Window -> FTP #1)

As soon as I have the dir where my_empty.log is located in the source pane, it goes fine, except that it asks to overwrite the file.

Only when I'm on a different dir, it comes back with "wrong parameter", or doesn't do anything.

The file dir is actually: "D:\dir with spaces\my_empty.log"

Have you got the correct, full path to the log file in the command?

Yes, I do. When I copy and paste the full path into the "path field" it opens the correct file.

OK.

So does anything appear in the FTP log when it doesn't work?

NO. Now when I repeat the action, the log file appears in my destination pane.

I especially created a ftp_address to the ftp site, with the particular destination dir.

It works fine for me, but I have to explicitly set the initial directory for the FTP bookmark (else the command will try to copy to the root directory, I think).

The initial directory usually needs to start with a /, e.g. /home/yourusername

Even without that set, though, I still see activity in the FTP log when I run the button, even if it leads to failure due to trying to copy to the root.

I was using this command, by the way:

Copy D:\my_empty.log TO="@My SFTP Site"

Thanks for thinking with me.

I found the problem: I omitted the trailing / in the ftp address.
I had: /web/mysite/log
It should be: /web/mysite/log/

Now it's fine.

I never understood the FILE-argument completely. To me there's to little in the help. So your example was clarifying. Thanks again.

Could you hand me a argument to silent the replace question?

Add WHENEXISTS=replace to the end of the line and you should be all set.

The WHENEXISTS=replace works fine, thanks

Now sometimes it works, and sometimes not.
I cannot find the right circumstances yet.
Sometimes it copies to the source pane, sometimes to destination.
Sometimes I try it, being logged in into the ftp site, sometimes in source, sometimes in destination.

The ftp logging now after pressing the button, shows "List complete 205 files". No messages about trying to copy and it didn't succeed.

I tried a little more today: when I replace the sftp by a local server address (//Myserver/test) it works allways. Independend of source and destination tabs open or not.
When I go back to @Log_ftp_address_book_account, sometimes the button does do nothing, sometimes I get a error: "the parameter is incorrect (87)".
The ftp log is empty.

Anymore ideas?

Hard to say without being able to reproduce it or test ideas out. It could have something to do with Opus trying to re-use an existing connection (e.g. one open in a background window) which has timed-out at the server but which the client-side hasn't noticed yet. When that happens it should work on a second attempt, though.