[x] I have searched the issues of this repository and believe that this is not a duplicate.
Description 😯
TruBudget currently uploads files in base64 encoded strings. This made sense when files were stored on chain.
However, it is not the most efficient solution:
Encoding and decoding takes processing power and memory.
Base64 encoding increases the filesize by about 33 per cent, which leads to longer transmission times. For more efficient file upload and storage, we can use a method designed for file upload: multipart/form-data.
Standard libraries for it are form-data on FE, fastify-multipart in api and multer in express services.
How to reproduce 🕹
Create a workflowitem and upload a large file
Cryptic error message appears
Screenshots 📷
Solution
[x] there are several magical numbers limiting the size of requests and in body validation (67000000, 104857600 , ...). These need to be replaced with meaningful constants
[x] add file size validation on the frontend. above error message comes from api after http request is issued.
[x] test with large files
[x] consider using multipart form data, maybe in the separate issue?
Description 😯
TruBudget currently uploads files in base64 encoded strings. This made sense when files were stored on chain. However, it is not the most efficient solution: Encoding and decoding takes processing power and memory. Base64 encoding increases the filesize by about 33 per cent, which leads to longer transmission times. For more efficient file upload and storage, we can use a method designed for file upload: multipart/form-data. Standard libraries for it are form-data on FE, fastify-multipart in api and multer in express services.
How to reproduce 🕹
Screenshots 📷
Solution
Your Environment 🌎