JSCAPE
  • Products
    • Managed File Transfer
    • JSCAPE SaaS
    • MFT Gateway
    • MFT Monitor
    • All Products
  • Solutions
    • All Solutions
    • Secure File Transfer
    • AS2 Server Software
    • File Synchronization
    • Reverse Proxy
    • Compliance
    • DMZ Streaming
  • Pricing
  • Company
    • Blog
    • Company
    • Contact Us
    • Clients
    • Case Studies
    • Testimonials
    • Certifications
  • Support
    • Help Desk
    • Documentation
    • Customer Downloads
Get a demo

How to delete a file on your server after it’s downloaded

Words by

John Carl Villanueva

Overview Sometimes, for security reasons or simply just to save disk space, we want certain files to be automatically deleted from the server as soon as its intended recipient has already downloaded it. Today, you’ll learn how to do that on JSCAPE MFT Server.

Published in:

Blog

/

Business Process Automation, JSCAPE MFT, Managed File Transfer, Triggers

Overview

Sometimes, for security reasons or simply just to save disk space, we want certain files to be automatically deleted from the server as soon as its intended recipient has already downloaded it. Today, you’ll learn how to do that on JSCAPE MFT Server.

What we’d like to do

auto_delete_after_download

How to do it

This particular auto-deletion process entails creating a trigger that:

  1. Responds to a “File Download” event, i.e., fires as soon as a file has been downloaded from the server;
  2. Affects any downloaded file, regardless of type, user, time of download, etc.; and
  3. Executes the “Delete File” trigger action, which performs the actual file deletion.

Let’s walk you through those steps now.

1. Create a new trigger

First, let’s create a new trigger. To do that, go to the Triggers module and then click the Add button.

01-mft-server-auto-delete-after-download

2. Select the “File Download” trigger event type

Next, give this trigger a name, e.g. “Delete Downloaded File“.

After that, select the “File Download” Event type from the drop-down list.

Click Next when you’re done.

02-mft-server-auto-delete-after-download

3. Enter a trigger condition (or not)

For this example, we want the trigger to affect any downloaded file, so just enter this expression into the Trigger Conditions box.

Success = TRUE

This tells the trigger to proceed only if the download was successful.

In some cases, however, you might want to restrict the automatic file deletion process to certain downloads. For example, you might want it to apply only to: certain files, or to files downloaded by a certain user, or only during certain times, etc.

In such cases, you can specify your conditions by entering logical expressions into the Trigger Conditions box. You can view the properties pertinent to this particular trigger event whose values you can use for filtering by clicking on the Variables button.

Here are a few examples of trigger conditions you can use:

✔ To restrict the auto deletion to jpg files:

LocalPath ~ “.*\.jpg”

✔ To restrict the auto deletion to files downloaded by a user whose username is “johnsmith”:

Username = “johnsmith”

✔ To restrict the auto deletion to files downloaded during Mondays:

DayOfWeek = 1

You can even use a combination of these conditions to filter the trigger even further.

Click Next as soon as you’re ready to proceed.

03-mft-server-auto-delete-after-download

4. Add the “Delete File” trigger action

Click the Add button.

04-mft-server-auto-delete-after-download

The trigger action we’ll be needing for this particular scenario is the one named “Delete File“. Select that from the drop-down list and then click OK.

05-mft-server-auto-delete-after-download

Because we want this to apply to the file that’s been recently downloaded, enter the variable %LocalPath% into the box labeled File. The %LocalPath% variable holds the complete path (directory and filename) of the file that was recently downloaded.

Click OK when you’re done.

06-mft-server-auto-delete-after-download

5. Finalize the trigger

Once you’re back at the main screen, don’t forget to click the Apply button to finalize your trigger creation process. Otherwise, this trigger won’t execute.

07-mft-server-auto-delete-after-download

And you’re done! Every time a user downloads a file from your server, that file will be automatically deleted.


Get Your Free Trial

Would you like to try this yourself? 

Get a free trial of JSCAPE MFT Server.


You might also want to read…

How To Automatically Decrypt PGP-Encrypted Files Upon Upload

Using Triggers to Automate File Deletion

Rotating and Archiving Logs in JSCAPE MFT Server

Easy To Deploy, Easy To Administer, Easy To Manage

Ready to see how JSCAPE makes managed file transfer so much simpler? Schedule your demo now.

Request a demo

Popular Articles

View more by

JSCAPE
  •  
    1–2 minutes
    23/09/2025

    JSCAPE by Redwood, version 2025.3: New UI continues to make a splash

    Dive back into JSCAPE by Redwood with version 2025.3, bringing more modern UI updates to make using and navigating JSCAPE more intuitive. 

    Read article

  •  
    1–2 minutes
    19/08/2025

    Weathering the economic storm: Expert support is your enterprise file transfer system’s lifeline

    The global economic landscape can be described by one word: “uncertain”. Lingering effects from the 2020 pandemic, combined with new waves of international tariffs throughout 2025, have…

    Read article

  •  
    1–2 minutes
    30/07/2025

    Escape the grip: Why flexible MFT is key to enterprise agility

    Break free from costly vendor lock-in Let’s be blunt: some MFT vendors have built product suites that are less about true partnership and more about proprietary siloing.…

    Read article

  •  
    1–2 minutes
    23/07/2025

    Avoid downtime and threat actors: Getting the best of both worlds in MFT

    For enterprise organizations relying on managed file transfer (MFT) solutions, cybersecurity often feels like an arms race. The need to patch MFT software vulnerabilities to prevent breaches…

    Read article

Related Content

Read more about

JSCAPE MFT
  •  
    1–2 minutes
    30/07/2025

    Escape the grip: Why flexible MFT is key to enterprise agility

    Break free from costly vendor lock-in Let’s be blunt: some MFT vendors have built product suites that are less about true partnership and more about proprietary siloing.…

    Read article

  •  
    1–2 minutes
    03/07/2025

    Consolidate, deploy and thrive: JSCAPE’s formula for MFT success in uncertain times

    Global enterprises today are navigating a landscape marked by significant economic volatility. Fluctuating markets, shifting trade policies and persistent economic uncertainty are compelling enterprise organizations to reevaluate…

    Read article

  •  
    1–2 minutes
    31/03/2025

    SFTP vs. FTPS: Which file transfer software is best for business use?

    What is SFTP? SFTP is a file transfer protocol that’s normally packaged with Secure Shell (SSH), the network protocol most IT administrators use to access and manage…

    Read article

  •  
    1–2 minutes
    25/03/2025

    EDI integration with trading partners: 6 best practices

    Many large companies with high-volume transactions, especially those involved in e-commerce, manufacturing and retail supply chains, have long migrated from manual processes to Electronic Data Interchange (EDI).…

    Read article

Company

  • About Us
  • Contact Us
  • Clients
  • Case Studies
  • Testimonials
  • Privacy Policy
  • Certifications

Resources

  • Managed File Transfer
  • Secure File Transfer
  • Secure FTP Server
  • AS2 Server
  • Reverse Proxy
  • File Upload Processing
  • What Is An AS2 Server?

Support

  • Help Desk
  • Documentation
  • Customer Downloads
JSCAPE

Copyright © 2025 JSCAPE

  • Privacy Policy
  • Cookie Settings