// Opens the PDF in a new browser tab Application.DownloadAndOpen("_blank", "/Reports/Invoice123.pdf"); Use code with caution. 4. Advanced: ZIP Files and Progress
// Simple download of a physical file Application.Download("/App_Data/Reports/Quarterly.pdf", "MyReport.pdf"); Use code with caution. 2. Generating Files Dynamically
For more complex scenarios, such as downloading multiple files as a single ZIP archive, you can use standard .NET libraries like System.IO.Compression to wrap your files into a stream and then pass that stream to Application.Download() . wisej download file
Download a server-side Image object directly as a file. Example: Downloading a Static File
Note: Always remember to set stream.Position = 0 before calling the download method, or the browser will receive an empty file. 3. Download and Open // Opens the PDF in a new browser tab Application
Whether you are building a data-heavy enterprise dashboard or a simple document portal, file management is a core requirement. In , downloading files is remarkably straightforward because the framework handles the heavy lifting of mapping server-side resources to the client’s browser session.
If you are handling very large downloads, Wisej supports Background Tasks to keep the UI responsive while the server prepares the file. Summary Table: Download Options Example: Downloading a Static File Note: Always remember
This guide covers the primary methods for implementing file downloads, from static server files to dynamic, in-memory generated content. 1. The Core Method: Application.Download()