Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload documents up to 75MB #1832

Closed
5 tasks done
SamuelPull opened this issue May 14, 2024 · 0 comments · Fixed by #1838
Closed
5 tasks done

Upload documents up to 75MB #1832

SamuelPull opened this issue May 14, 2024 · 0 comments · Fixed by #1838
Assignees
Labels
api Indicates api related issue or feature blockchain Indicates blockchain related issue or feature bug Something isn't working frontend Indicates frontend related issue or feature storage-service Indicates storage-service related issue or feature

Comments

@SamuelPull
Copy link
Collaborator

SamuelPull commented May 14, 2024

  • 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 🕹

  1. Create a workflowitem and upload a large file
  2. Cryptic error message appears

Screenshots 📷

Clipboard - 10  Mai 2024 15_23

Solution

  • there are several magical numbers limiting the size of requests and in body validation (67000000, 104857600 , ...). These need to be replaced with meaningful constants
  • add file size validation on the frontend. above error message comes from api after http request is issued.
  • test with large files
  • consider using multipart form data, maybe in the separate issue?

Your Environment 🌎

Tech Version
Frontend v2.?.?
API v2.?.?
Blockchain v2.?.?
Export-Service v2.?.?
Email-Service v2.?.?
Storage-Service v2.?.?
@SamuelPull SamuelPull added the bug Something isn't working label May 14, 2024
@issuelabeler issuelabeler bot added api Indicates api related issue or feature blockchain Indicates blockchain related issue or feature frontend Indicates frontend related issue or feature storage-service Indicates storage-service related issue or feature labels May 14, 2024
@SamuelPull SamuelPull self-assigned this May 14, 2024
@galethil galethil added this to the Trubudget 2.12.0 milestone May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Indicates api related issue or feature blockchain Indicates blockchain related issue or feature bug Something isn't working frontend Indicates frontend related issue or feature storage-service Indicates storage-service related issue or feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants