I'm developing a website (using PHP, JS, and MYSQL) which allow user to upload images. My requirements are as below:
- User is able to upload 1 or multiple images at a time.
- Website is able to save the original images and using the original images to create a re-sized version e.g. 500x500 px
What I've done
I need some opinions regarding the decisions I've took/implemented as below, let me know if it is right or wrong :)
- I did not store the images in database as blobs.
- I have an image table in the database which store image name and image path. The image path is a string which will be the exact folder name in the filesystem, the image name is the name of the image uploaded by user. Combine both will create a path direct to the file system.
- Using above method I am able to query the images as if it was stored in my database but actually I am just mapping them.
- Is my approach correct? I am thinking about JSON but is it useful in this case?