Topic "File download by using GET function"

Author Message
sunshine0618
[View user's profile]

Joined: 2014-07-17
Posts: 3
Hi, everyone,

I'm trying to download bunch of files from a SFTP server.
I found the following script in the webpage,"http://winscp.net/eng/docs/scripting", and gave it a try.
My destination folder is assigned to D:\WinSCPDownload\A
The process failed with an error message of "D:\WinSCPDownload\A" is not a file.
however, it worked when the destination folder is D:\

I searched for some other examples, and showed that subfolders under D:\ also work out well.
I have no ideas why it just doesn't work out for me.
Am I missing anything?
Thanks for helping

option batch abort
option confirm off
open sftp://user@example.com/
cd /home/user
option transfer binary
get examplefile.txt d:\WinSCPDownload\A
close
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
The target directory path has to end with backslash:
get examplefile.txt D:\WinSCPDownload\A\

The get examplefile.txt d:\WinSCPDownload\A means download file examplefile.txt to file A in directory d:\WinSCPDownload.

See http://winscp.net/eng/docs/scriptcommand_get
sunshine0618
[View user's profile]

Joined: 2014-07-17
Posts: 3
It turned out to be a "\"
I really appreciate your help!!
Thanks for your reply.
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