162
Views
8
Comments
How is the best practices to download a large file?
Application Type
Reactive
Service Studio Version
11.55.4 (Build 63890)
Platform Version
11.33.0 (Build 44426)

I have a table that stores a file in Binary Data format. This file is reaching 330MB and was causing a timeout. However, significantly increasing the timeout is not a viable solution. What is the best practice to make this download available? 

2026-03-04 12-08-39
Luiz Henrique Stanqueviski

Hi João,


If I understand correctly, are you facing timeout while downloading the file?Or is it in some stage of preparing it for downloading later?

If you can, post the action you are taking on the forum so we can evaluate and help you.

2024-04-02 13-23-43
Gonçalo Ferraria
Champion

 Hi Joao,

For large files, I recommend considering external file storage solutions such as AWS S3 buckets, Azure Blob, SharePoint, OneDrive, Google Drive, or even the more traditional FTP server for saving generated files. 

OutSystems provides prebuilt connectors for all these external file storage options available in the OutSystems Forge. 

By using these external storage solutions, you can prevent your database from becoming excessively large over time and optimize the download operations.

I hope this helps.

Thank you!

2024-02-16 11-58-28
Sheikh Mohd Fahad

Hi João,

If your requirement is to use only the OutSystems database for file downloads, I recommend creating a mechanism to ensure the file is fetched successfully without timing out before the download.

You can implement a process to load the file in the background and notify the user once it is ready for download. This approach allows the user to wait while the file is being prepared and ensures a smoother download experience once the fetching process is complete.

I hope this suggestion helps!


2021-01-04 08-13-48
Toto
 
MVP

Hi João,


The best practice is like @Gonçalo Ferraria said, this involving designing the application to connect to storage solutions.

But as a temporary solution, you can try to fetch the data in server action, then use either zip extension or bigzip (https://www.outsystems.com/forge/component-overview/356/bigzip-o11) to zip the data and send the binary back to the client action to downloaded. This is not best practice, but works as temporary solution.



2024-12-18 16-06-42
Junaid Syed

Hello Joao,

Storing such big files on cloud storage for instance AWS S3 etc. is the best option as suggested above. However, if that is not an option for you at the moment, based on the content of your file you might consider breaking it down into smaller chunks. Probably not all the users might be interested in the full 300 mb file.

Further it sounds that you are allowing the end users to download the file synchronously. This is not a recommended practice at all to block the application and hence the end user until file download is finished or timeout occurs. Instead handles such time consuming tasks asynchronously through background processes or timers.

Hope it helps!

Junaid

UserImage.jpg
Md Mansur

Hi @João Pedro Assunção Oliveira 

Yo have two ways to download large file 

1.Store you File in external like  such as AWS S3 buckets, Azure Blob, SharePoint, OneDrive, Google Drive, or even the more traditional FTP server for saving generated files only store link in your data base when you click to download this File

2. if you store large file in outsystems so on the page load or on Initialized event you can run a BPT or Process to prep a File and when a click button than Download  


Thanks

Md Mansur

2025-04-21 14-34-14
Duong Hoang Anh

Hi @João Pedro Assunção Oliveira,

1. Use Web Screens with File Download Logic

  • Generate the File on the Server: If the file is dynamically generated, use OutSystems logic on the server side to create the file. This can include generating reports, data exports, etc.
  • Send the File in Chunks: Instead of trying to download the entire file at once, break it into smaller chunks. This will improve the download speed, reduce the risk of timeouts, and offer a better user experience.
  • Leverage OutSystems' built-in download mechanisms:
    • File Entity with Binary Data: If the file is already available as an entity in your database, serve it using a binary data response.
    • OutSystems' DownloadFile action: Use this built-in action to trigger the download. It works well when downloading files from the server.

2. Use a Cloud Storage Provider

  • Store Large Files Externally: If the file is too large to be managed effectively within OutSystems or the database, consider storing it externally (e.g., in Amazon S3, Azure Blob Storage, or Google Cloud Storage).
  • Generate a Signed URL: Once the file is stored externally, generate a signed URL with limited access to allow secure and direct download by the user. This keeps your application from handling large files directly, reducing the load on your OutSystems server.

3. Background Processing

  • Background Jobs for Long-Running Tasks: If file generation or processing takes time, use background processing (e.g., with OutSystems' Integration Studio or by utilizing scheduled jobs) to prepare the file in advance. Notify the user when the file is ready to be downloaded.
  • Download Link Notification: For long-running tasks, provide users with a notification (e.g., email or an app notification) when the file is ready for download. This avoids holding up the user interface during the file generation process.

4. Optimize File Size

  • Compress Files: If possible, compress the file before making it available for download. For example, use ZIP compression for large documents or images to reduce file size and speed up the download process.

5. Handle File Download on the Client Side

  • Using JavaScript: For more control, consider using JavaScript (via OutSystems' JavaScript API) to manage the download process, including adding features such as pause, resume, or progress tracking for very large files.


Thanks 
AnhDH

2025-09-25 14-38-22
Lokesh Kumar Yadav

Stream the File from Storage

  • Store the File Externally: Use a file storage service like Amazon S3, Azure Blob Storage, or OutSystems File System.
  • Generate a Temporary URL: Generate a secure, pre-signed URL for the file and provide it to the user for direct download.

2. Chunked File Download

  • Break the File into Chunks:
    • Save the file in smaller chunks in the database or an external storage solution.
    • Use paginated or sequential requests to download the chunks and reassemble them on the client.
  • How to Implement:
    • Create a REST API or Server Action to return parts of the file based on offsets.
    • Use JavaScript or a client-side library to handle chunked downloads.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.