Description
I am working on an application using Angular (front-end) and Hibernate (back-end). My use case involves uploading multiple images, which I convert to base64 format and send as JSON with additional information for each image from the front-end.
The issue I’m encountering is that the HTTP request exceeds the maximum size limit due to the large base64-encoded images. I’m struggling to find an optimal solution for this problem.
What I’ve Tried
-
Base64 Conversion: I have converted the images to base64 to include them in the JSON payload, which is causing the size issue.
-
Single Transaction Requirement: I need to keep the images in a single request because multiple database transactions are performed on the back-end that require all the information to be received together.
Research and Analysis
- Chunked Uploads: I’ve considered splitting the images into smaller chunks, but I am unsure how to handle the reassembly and ensure all the information is processed correctly in a single transaction.
- Alternative File Upload Methods: I have read about multipart uploads and other methods, but I am concerned about maintaining the integrity of the database transactions and ensuring that all images and their associated data are processed together.
Request for Help
Has anyone encountered a similar issue or can suggest a solution for handling large file uploads in Angular and Hibernate without exceeding the HTTP request size limit? Any guidance or best practices would be greatly appreciated.
Thank you!
Alejandro Corral is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.