Topic "Scripting Assistance"

Author Message
WellConnIT
[View user's profile]

Joined: 2017-01-05
Posts: 2
Location: Sydney
Hi,

I've got two scripting questions.

I've got two folders, Graphics & Swatch ;

I have a remote FTP server that has corresponding folders.
Each Folder has it's own script(to allow the user to upload a single folder rather than both = less time)

Using WinSCP I can successfully connect and upload files ; however:
1. I can't seem to be able to find out how to use the uppercase function of the GUI to change the filenames of all the swatch files to uppercase.

2. Is there a way I can keep the folders up to date without needing to re-transfer files that had already been transferred, like an update function vs a send all??
2a. If there's no function to update only new files, then how would I go about changing the name of the extension only after the file has successfully been uploaded(so that it does not change the name of a file that has failed - currently only uploading *.jpg).

Below is the code I"m using for the graphics:
<code>
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/ini=nul ^
/command ^
"open ftp://UserName:Password@Server/" ^
"lcd C:\Users\Andrew\Documents\Graphics" ^
"cd /Graphics" ^
"put *.jpg" ^
"exit"

@echo off

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
pause

exit /b %WINSCP_RESULT%

</code>
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26109
Location: Prague, Czechia
WellConnIT wrote:
1. I can't seem to be able to find out how to use the uppercase function of the GUI to change the filenames of all the swatch files to uppercase.

Use the Interface\CopyParam\FileNameCase raw configuration option:
https://winscp.net/eng/docs/rawconfig

Quote:
2. Is there a way I can keep the folders up to date without needing to re-transfer files that had already been transferred, like an update function vs a send all??

Use the -neweronly switch of the putcommand:
https://winscp.net/eng/docs/scriptcommand_put

Or the synchronize remote command:
https://winscp.net/eng/docs/scriptcommand_synchronize
WellConnIT
[View user's profile]

Joined: 2017-01-05
Posts: 2
Location: Sydney
Thank you very much for your assistance both of those solutions worked perfectly.

I'm now looking for a cmd line tool that I can use to compress images on the fly, so if anyone knows of one that compresses JPG images well that'd be great.

Thanks again.
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