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?
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.
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!
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!
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.
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
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
Hi @João Pedro Assunção Oliveira,
1. Use Web Screens with File Download Logic
2. Use a Cloud Storage Provider
3. Background Processing
4. Optimize File Size
5. Handle File Download on the Client Side
Thanks AnhDH
Stream the File from Storage
2. Chunked File Download