#Save images in mySQL using TypeORM
7 messages · Page 1 of 1 (latest)
I would suggest not storing images in the database. Use a dedicated file store like the hard drive, s3, or other file storages. They'll be more efficient with the space and you won't needlessly take up database resources for things you won't query on.
In the database, save the URL of the image so that you can retrieve it
I forgot to mention that I try to develop a website, in which images can be seen by everyone, so I need to use database
Images being seen by everyone does not mean you need a database to save the images in. My statement still stands
You mean that we can store image into the server without using database ?
Yes. Or some dedicated file store. S3, Google's Firestore, Azure's Azure Files, or other storages as a service (STaaS)
i would like to addon you can even store images on the server it self locally
although it is recommended on a external server as it is more secure this way
see owasp guide for this
https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html#file-storage-location
it is possible to store images on DB by encoding a image into base64 string saved on DB
but for all of the better dont, dont bring such a thing upon this cursed world
Website with the collection of all the cheat sheets of the project.