Monitor a directory, and upload/archive files as they arrive FTP Script! version: 3.1.6+

Monitoring a directory for certain files, and as soon as they become available (someone puts them in that directory) upload them somewhere else and then move the original files to a different location (archive) on the local disk. This is one of the most common questions from our FTP Script! users.

For such reason we have prepared the sample script below. It will probably fit the most common cases, and it’s a decent learning tool as well as starting point to create your own (more complex) scripts to accomplish your very own particular task.  Continue reading

How to prevent uploads of EXE files Server! version: 4.0.0+

Some SFTP servers feature a simple “extension exclusion list” so that administrators can specify certain file extensions that the server should not let users upload. But that’s a pretty weak defense, as a clever attacker could always upload an EXE with a fake extension and then rename it or otherwise find alternative ways to run it on the server, thus compromising its security. Server!’s scriptable nature, though, allows you to do a lot more than just disallow certain file extensions. Here’s a sample script that can be attached to the “AfterFileUpload” event handler, to identify EXE files that have been uploaded with fake extensions and delete them right away.

The above script is provided as a mere example to identify Windows EXE files. But it could be easily modified in order to identify other file types.

All Windows EXEs, in fact have stable distinguishing features in their binary code, and more precisely: the first 2 bytes (in hex) will always be 4D5A, and the 4 bytes at offset 256 (0x100) will always be 50450000. So if a file has those byte sequences in those exact locations, it’s safe to say it’s a Windows EXE.

Do you need to identify ZIP files instead? The first 4 bytes are always 04034B50.

And so on… many file types can be identified by specific “signatures” in their binary code, that one can easily read using Server!’s powerful scripting capabilities. Server!: VFS with quotas Server! version: 4.0.0+

The Virtual File System (VFS) instroduced in Server! v4.0, comes with a long-awaited feature: quota management.

The Windows OS features a very powerful yet complicated quota management, but it’s only available in Windows Server editions and requires optional features to be installed, therefore we could not rely on that and we built our own quota management system which is cross-compatible with all Windows systems.

Now, the problem with quota management is that calculating the current size of a folder (along with its sub-folders) can be very time-consuming, if the folder contains millions and millions of files. So if we were to re-evaluate the size to enforce quota restrictions at every operation it could totally kill the performances. Our solution the Quota TTL, which is the Time-To-Live (TTL) of the quota cache, expressed in seconds. Basically, when Server! calculates the current size of a folder structure, it will consider such result valid for QuotaTTL seconds, without re-evaluating it too often. Continue reading

How to increase the speed of SFTP downloads Server! version: 3.0.0+

If you run Server! hosted on a VM in the cloud or at some co-location provider, you are probably aware that your ISP uses traffic shapers to optimize the transfer speed and to prevent malicious users from abusing network resources.

In some cases, though, such strategy (packet/traffic shaping) clashes against the very nature of the SSH/SFTP protocol, in which both control and data packets are sent on the same connection. In particular, you may experience issues between the requested SSH socket buffer and the advertised buffer size on the network. If that happens, we got you covered! As of version 4.0, in fact, you can use a special Registry key to force Server! to use a socket buffer size that matches the one advertised by your network. Continue reading

Scripting lesson: email a list of all uploaded files Server! version: 3.1.21+

One of the ready-made script examples that is installed along with Server! shows how to notify someone via email each time a file is uploaded. But what if you wanted to send only one email, at the end of the file transfer session, with the list of all files that were uploaded in such session?

You can easily do that with 2 simple scripts bound to 2 different event handlers.

First of all you will need a script bound to the “AfterFileUpload” event handler, to keep the list up to date:

Continue reading Server! v3.0 will feature speed limits

Just a quick note to let our users know that our dev-team has just finished implementing speed limits in Server! v3.0. Tested. It runs smoothly.

Speed limits can be configured globally (server-wide, per instance) as well as individually for each user, and the upload and download speed limits can be specified separately.

Here you can see a file transfer with the speed limit disabled. This test was performed on a 100 Mbps LAN, and as you can see the upload speed is 12.95 MB/s (103.6 Mbps, with compression, LAN bandwidth is saturated).


Now, this is the same test, but with speed limit enabled. As you can see, the upload only takes up to the allocated bandwidth and does not saturate the LAN.


Speed limits can be configured globally, per user, or per network. Therefore you can have different speed limits applied to the same user depending on the IP address he/she is connecting from.