Topic "Session.MoveFile issues"

Author Message
qb
[View user's profile]

Joined: 2015-02-23
Posts: 2
Ok, so I've figured out a few things, but this is strange.
According to what I have read Move File is pretty easy.
Session.MoveFile(source,target)

Well, I picked transfer.filename for the source. I do an upload (push) then go into an IF , if I have no errors.
In my IF i am trying to do a session.movefile(transfer.filename, target).

My target fails every single time.
I tried creating a string var and giving it a local path.
I tried @"c:\dir\*"
I tried "c:\\dir\\*"
I tried "c:/dir/*"
I tried "dir/*"
I tried "/dir/*"

With and with out the *...you get the idea. Side bit of info,
when ever i tried to plug in the source as in @"C:/dir?*" (or others...I'd always get "Element mv not found". So I figured if the transfer.filename worked I'd run with it.

Ok, back to teh issue at hand, the error I always get for the target is "path not found".
Any ideas?
Thanks
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24552
Location: Prague, Czechia
Not sure what you are trying to do. Are you aware that Session.MoveFile is for moving/renaming remote file to another remote folder or name?
You cannot use it with local files.
http://winscp.net/eng/docs/library_session_movefile

If you are trying to move a local file to a remote directory, use Session.PutFiles and set remove argument to true.
http://winscp.net/eng/docs/library_session_putfiles

Quote:
when ever i tried to plug in the source as in @"C:/dir?*" (or others...I'd always get "Element mv not found". So I figured if the transfer.filename worked I'd run with it.

That's looks like a bug (no matter if you used Session.MoveFile incorrectly. Please attach a code and full debug log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.DebugLogPath. Submit the log with your post as an attachment. If you do not want to post the log publicly, you can mark the attachment as private.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License