0

Tip: Exluding file types from being uploaded to your server with post-processing

Currently, you cannot configure your server to exclude certain files from being transferred to or from it. Exclude configurations are only an option when set on the client.

There is still a way to exclude certain files from being uploaded to your server using the post-processing feature.

You can create a post-processing script which automates the immediate deletion of all unwanted files after they are transferred to your server. A post-processing script is run for every transfer, no matter which type of client initiates it.

As an example, you could create a BASH script if you’re using a Linux or Mac system to check if the filename of a transferred file ends in .exe. If it does, you simply remove the file:

#!/bin/bash

if [ $TYPE == File ]; then   
if [ $STARTSTOP == Stop ]; then       
if [[ $FILE == *".exe" ]]; then           
echo "Deleting $FILE ..." >> /tmp/exclude.log           
rm $FILE       
fi   
fi
fi

 

This script looks at each file after it has finished being transferred ($STARTSTOP == Stop), and if it ends in .exe, it removes it and logs this action.

 

 

0 comments

Please sign in to leave a comment.