A user wants to download a PDF report stored on the server to their device via the application. When the user clicks the ‘Download File’ button, the Download File From Server action is triggered and the file is securely downloaded to their device.
Adding the Download File From Server Action to the File Download Area
- Open your project on the Kuika platform.
- Enter the UI Design module.
- Add a Button element from the left panel (e.g., ‘Download Report’).
- Select the button, click the + ADD ACTION menu on the right panel.
- Select the OnClick → Device → Download File From Server action.
Configuring the Download File From Server Action
- File Path: /documents/annual_report.pdf (The path of the file to be downloaded on the server.)
- File ID: file12345 (The unique system ID of the file.) This ID is usually obtained automatically via ActionResult as a result of the ‘Upload File’ action (ActionResult.UploadFile.fileId).
With this configuration, when the user clicks the file download button, the file is saved to the device.