How can I insert an image data in MySQL Database and then retrieve it using Golang?
Basically I want that task for upload profile picture of user in web application. According to the my knowledge,the best solution is save image as blob object in database.Is it best solution for upload image in webapplication in golang.?
Please help me find the best solution for that.I want to find the solution in golang.I am beginner for golang programming.
Is there a particular reason for storing an image in the db instead of store the image path? I suggest you to store only the path since the databases are structured for data and not for blobs.
But if you want whatever it takes, convert the image into base64 and store the result inside a string field.