Topic "Upload file from perticular local Directory"

Author Message
Nizar
[View user's profile]

Joined: 2014-08-20
Posts: 3
Hi Team,

I am new to WinSCP. I use following script and it works fine to upload test.txt file exists in "winscp554" directory. I want to upload file from local directory "D:\FTP\Upload" instead of "C:\winscp554". Would you please guide me in proper direction?

I am using WinSCP product version 5.5.4.0. Please let me know if you require more info. Thanks in Advance.

C:\winscp554>WinSCP.com /script=FTP_Upload.txt

--------------- FTP_Upload.txt -----------
option batch abort
option confirm off
open sftp://user:password@example.com/
put test.txt
exit
------------------------------------------
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Just use a full path to the file:

put D:\FTP\Upload\test.txt

Or change local working directory to D:\FTP\Upload. Either before starting WinSCP or from WinSCP script using lcd D:\FTP\Upload.
_________________
Martin Prikryl
Nizar
[View user's profile]

Joined: 2014-08-20
Posts: 3
Thanks Martin. I use "lcd D:\FTP\Upload" and it works fine.

But when I change it to the folder name with space it provides error message Too many parameters for command 'lcd'. For example, it provides error message for "lcd D:\MY FTP\Upload". Is there anyway, I can include folder/directory with space?

For you information, I am using WinSCP Portable application (v5.5.4.0).
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
You need to wrap any path with spaces to double quotes (it does not harm to wrap any path to double quotes).

I.e. lcd "D:\MY FTP\Upload"
Nizar
[View user's profile]

Joined: 2014-08-20
Posts: 3
Thanks a lot it worked now. Appreciate your help.
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