In a web application, users should be able to upload documents such as IDs, diplomas or certificates and then view, download and, if necessary, delete them. Documents should be stored in user-specific directories and process steps should be traceable through the system.
File upload
- Click on the Big File Upload element.
- In the Properties panel on the right side, in the Label field, type “Upload your document”.
- Then in the Hint field type “You can only upload .pdf, .jpg or .png extensions. Max. size: 200 MB”.
- When the upload is complete, the following actions are triggered:
- File ID and File Name are retrieved from the system.
- It is associated with the related record in the user table and saved to the database.
INSERT INTO user_documents (user_id, file_id, file_name, upload_date)VALUES ({{currentUser.userId}}, {{uploadedFileId}}, {{uploadedFileName}}, NOW());
The File ID will be the reference for all downloads and deletions. No action can be taken without saving.
File download
- Add a Button element from the Elements panel on the left side.
- In the Properties panel, type “Download Document” in the Label field.
- Choose OnClick → Device → Download File From Server from the +ADD ACTION menu.
- Edit the following field:
- File ID: Enter the unique ID number of the file to download. (Ex: {{{selectedDocument.file_id}})
File deletion
- Add a Button element from the Elements panel on the left edge.
- In the Properties panel, type “Delete Document” in the Label field.
- Choose OnClick→ Device → Delete File From Server from the +ADD ACTION menu.
- Edit the following field:
- File ID: Enter the unique ID number of the file to be downloaded. (Ex: {{{selectedDocument.file_id}}})
The user must be presented with a confirmation screen before deletion. The deleted file cannot be recovered.
This example scenario is using Big File Upload;
- File upload,
- File-based data recording,
- Secure downloads and deletions,
- Authorization and user control is provided.