0
Let’s assume I have a user registration form where I want to save a photo of it. Send this data by POST
to the server (Java) where I include in the database.
What is the best (practical) way to send this photo along with the other data to my server? Save this image in a directory or in a field BLOB
in the database? I have to send the image as a Array
of bytes
? And how can I recover that image when I make an appointment at my bank?
If possible I would like some examples or explanations.
To save to the server, the best option is to save the image to the disk and only its path in the database. To recover the image would take the path in the database and make a request in the image path (Ex: my.server.com/images/image.png)
– Daniel
Got it, and how do I upload to the server?
– DiegoAugusto
You can do this in two ways: 1 - uploading the image to the server and saving the link or reference in the database. 2 - creating an image Base64 rash and saving in the bank.
– Ivan Ferrer
Here is an example generating rash: https://www.base64-image.de/step-1.php?m=1
– Ivan Ferrer