Select already existing images on server

Hello guys,

I would like some help…
I’m trying to build an eshop and in the products section I need the administrator to be able to
a) insert/upload new images for each product
OR
b) select images that already exist on server (have been uploaded in the past).
Of course this method will be used and when a product is edited/updated.

So, there will be a dropzone component handling multiple images upload and a button “Select existing Image/s” that will give the ability to browse a server’s specific path (e.g.“assets/images/products”), select one or more images and update the database field/s with the name of the image/s.
I suppose you understand what I’m trying to do and there are more cases that I will need to use this technique/method (e.g. “Featured products”).
The “upload new images” method is known but the alternative method “select already existing images” is what I am trying to find out.

Any advise or ideas will be much appreciated!
Handler: PHP
Database: MySQL

My personal preference is to create a folder for each product, especially if multiple images per product are involved. The folder gets the name of the product ID and has a subfolder for the thumbnails. This can be extended to adding folders for other image formats.

If a product is deleted, all that is required is to delete the folder, thus removing the images.

I would not use an image for more than one product for fear of having a folder with redundant images.

An archive of images can be held on a local system.

I know that this is not what you described, but experience has shown that this is the better method.

Thanks @ben for your valued answer. Your experience means a lot to me.
You just took me back to reality! I was ready to walk on a forbidden path. It’s a different think the “featured products” and “featured images” that I was had in mind.
So, you’re absolutely right.
But, by the way, is there a way to browse the images that are uploaded on server and get their name?

Have a look at

In particular

1 Like

Thanks a lot @ben!!

1 Like