Multiple file download using php and sql | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Multiple file download using php and sql

I'm trying to make images downloadable based on the users choice but not as a zip file, because on user experience. Please can someone help me out

2nd Aug 2020, 2:48 AM
Prosper Emebo
Prosper Emebo - avatar
3 Answers
+ 2
You can do it on the frontend. just load the images dynamically using PHP on frontend from your database. Insert the <img> tag in between anchor tag. Then set the download attribute on anchor tag and point the href to the image URL when the user clicks on the link it will download the image. Like this. <a href="image URL" download><img src="image URL"></a>
2nd Aug 2020, 3:55 AM
Maninder $ingh
Maninder $ingh - avatar
+ 1
It's helpful, but how can I load images from databasd
13th Jul 2021, 9:12 AM
Rawley
Rawley - avatar
0
Storing images in a database is not a good idea, because you can bloat it with bigger ones. You store a reference to the image like the absolute URL then dynamically load it into the img tag.
28th Jul 2021, 10:39 AM
Prosper Emebo
Prosper Emebo - avatar