ScriptFTP 4.6

17th July 2019

This new release comes with two new commands (EXIST and TEXTFILEREAD ) and support for the latest SFTP encryption algorithms. As usual, some other bug fixes have been addressed.

  • [New] Support for the latest SSH encryption algorithms. This will allow ScriptFTP to log in to the SFTP server than enforce the client to support the latest security standards.
  • [New] Added a new command: EXIST . With it you can quickly check if a file already exists without using GETLIST and FOREACH
  • [New] Added a new command: TEXTFILEREAD. It is used to read the full contents of a text file and store them in a variable.
  • [Fix] SETPASSIVE was only working when used after OPENHOST. Fixed to be working whether or not is used after or before.
  • [Fix] SETSPEED was not working as expected in some servers.
  • [Fix] Fixed the default position if the schedule script window. It was being centered in the primary screen instead of the parent window
  • [Fix] Fixed the text box where the minutes of a scheduled script was entered was not padding zeroes on minutes. For example. It showed 12:1 instead of 12:01
  • [Fix] Fixed an infinite loop that happened when called ScriptFTP.exe from ScriptFTP itself
  • [Fix] Many minor bugs have been fixed. Mostly related to memory management and performance.

Tags


Uploading only the files created or modified in the last 7 days

29th January 2019

 

The following script shows how to upload to the FTP server the files from the last 7 days. If a file is more than 7 days old it will be ignored.

Note that this example does not work with subfolders.

 

read more …

Tags


How to download the files created in the last 48 hours

21st November 2018

 

Date and time operations in ScriptFTP are something that we often get asked in the tech support email. ScriptFTP stores time ranges in seconds and this is sometimes counter-intuitive if you want to do date and time operations like checking how old a file is. Fortunately, this type-free approach in the ScriptFTP language also makes the syntax easier to understand.

Well, let’s go to the actual topic of this blog post: How you can check if a file in the FTP site was created in the last 48 hours and if so download it. Here is the script. The comments in it are very self-explanative:

read more …


How to delete all the sub-directories in a directory

12th August 2018

Recently we received a question from a customer that was using a set of IP cameras and a central FTP server where the cameras stored their recorded videos. As the cameras generate a lot of data they wanted to schedule an FTP script that deletes all the sub-folders of a given folder.

 

The script is pretty straightforward, all it is needed is to use GETLIST to retrieve the list of sub-directories, then use FOREACH and RMDIR to delete each one:

 

read more …

Tags


Network drive not available when the FTP script is scheduled

21st July 2018

As all Windows applications, ScriptFTP supports the use of UNC paths and network drives. You can use the files and folders stored in them as if they were located in hard drive of the machine where ScriptFTP is running. For instance:

 

# Upload to the FTP server all the Excel files stored in the mapped network drive Z
PUTFILE("Z:\the_folder\*.xlsx")
 
# Upload to the FTP server all the Word documents stored in a network share called Reports
# under the computer named ACCOUNTING-PC-1
PUTFILE("\\ACCOUNTING-PC-1\Reports\*.docx")

read more …


ScriptFTP 4.5

5th February 2018
  • [New feature] Sending emails from ScriptFTP is now much easier thanks to the new command SENDEMAIL. Previously it was required to use the EXEC command to call and external program. The SMTP email server is set up using SETEMAILSERVER and SETEMAILSERVERPORT
  • [Fixed] ScriptFTP_console.exe was always returning 0 as exit code. Even when the EXIT command was used with a non-zero exit code
  • [Fixed] More detailed error messages when an internal error happens
  • [Fixed] OUTPUTDETAIL(SILENT) was wrongly showing the “skipped file” message on SYNC
  • [Fixed] Stopping the script with the ESC key was being attempted by ScriptFTP even when the script was not running producing an error message.
  • [Fixed] PUTFILE2 was not working at all. Fortunately, this command is not used very often and this is because it was unnoticed.
  • [Fixed] SYNC now set the new file modification times using the server-client clock time difference when available.
  • [Fixed On the first startup the ScirptFTP window was being placed in the upper left corner of the first screen. Now it is up to Windows to place the window on the first run. Then the last position is saved.
  • [Fixed] The output of the EXEC command was not showing the line breaks of the output of the external command properly. Sometimes everything was being shown in one line.
  • [Fixed] Forced to use UTF8 encoding on SFTP.
  • [Fixed] The FTP protocol command PWD was called once for every remote file when the ScriptFTP’s SYNC was used even when the file did not match the wildcard. This caused many not required PWD calls to the FTP server.
  • [Fixed] The ScriptFTP setup failed sometimes when there was no internet connection. Now it handles the connection error properly.

Tags


How to check if a file exists in the FTP server

22nd November 2017

This blog post shows how to check if a file exists in the FTP server. The shown example tries to download a file only if it exists but if it does not exist it creates an empty file locally. The filename here is EXAMPLE.txt but it can be any other name.

Beware that this script does not go through all the directory tree in the FTP server searching for the file. It only checks one directory (/remotedir) and does not go through subdirectories. This is done getting the file list first with GETLIST and then we use FOREACH to compare every file name we got in the previous step with the text string “EXAMPLE.txt”:

 

# Connect to the server
# Get the list of remote files
 GETLIST($my_remote_files, REMOTE_FILES)
 
# We will save in this variable whether or not the file exists
 $exists="no"
 
# Go one by one through the list of remote files
 FOREACH $file IN $my_remote_files
     IF($file=="EXAMPLE.txt")
          $exists="yes"
     END IF
 END FOREACH

read more …

Tags


How to get the latest file out of each folder

6th November 2017

 

Recently a user has asked via the website chat (the icon at the lower right corner) an interesting question:

 

I am looking for scriptable FTP to do the following… I have an FTP location with many folders(about 500.) I would like to get the latest file out of each folder. Or better yet, get the latest file out of a list of folders. Can your program do this recursive FTP?

 

The answer is yes. It is possible to get the latest file out of a list of folders. It is not a simple script but it is definitely possible. The steps needed are the following:

  • Store the list of remote folders where you want to look in a variable. Each item of the list is separated by the | character.
  • Use the FOREACH loop to run a set of FTP commands for each folder defined in the previous step
  • Use the command GETLIST to retrieve the list of files in a folder.
  • Use again the FOREACH loop to run a set of FTP commands for each file.
  • Retrieve the last modification time of the remote file using GETFILETIME and save it in a variable.
  • If it is the most recent modified time we have seen store also the path of the file.
  • Once all the files are processed go the next folder of the list.
  • When we have reached the end of the folder list download the file using the path we have saved in a variable.
The only drawback of this script is that it only handles the files in a folder directly, not files stored in subfolders. In other words, it does not go through a tree of subdirectories. But there is a workaround to this limitation: You can add the subfolder to the folder list as /myfolder/mysubfolder.
The full script and its output is:

read more …

Tags


How to create a local folder using the current date

23rd October 2017

Dates can be written in multiple ways, not only because of the language used (English, Spanish, German…) but also within the same language we can write a date in many different ways. For example in English, we can write it as “20 October 2017”, 20/10/2017, 10/20/2017 etc.

In ScriptFTP the most common formats of dates are available in the GETTIME command but sometimes you need to retrieve the date or time components separately (month, day, year, hour…) and build your own expression of a date or time. In this example, it is shown how to build a date expression without spaces and using a three letter month, for example “20Jan2017”. We will then use it to create a local directory.

 

read more …

Tags


ScriptFTP 4.4

2nd October 2017

This is another small bug fixing release. Unless you have experienced problems installing ScriptFTP or use IBM zOS servers it is not worth applying this small update.

  • Fixes on how RAWCOMMAND and FTP protocol NOOP command are sent to IBM zOS servers
  • Fixed some WinHTTP Runtime errors during setup.
  • Hot keys F5,F8 and ESC now works regardless of the element of the ScriptFTP window has the focus
  • SILENT mode fixes. SYNC now shows the uploads/downloads even on silent mode as it was supposed to happen.

 

Tags