Download image to desktop from database

A

Anonymous

Guest
I personally would NOT be saving the image to the database, but rather the path where the image is located on the server and the name of the image to the database table. In my opinion it serves two purposes, one it doesn't bog down the database table and there's less likelihood that the database is going to be hacked or corrupted by users intentionally or unintentionally doing something. As long as the image file is rename and is moved to a subdirectory (not the root directory) you should be ok. Using a standard HTML form to check the name with the path and name stored in the database table you should be all set to go.
 
This page has code that shows how to store and retrieve images from a database :

https://phpro.org/tutorials/Storing-Images-in-MySQL-with-PHP.html
 
If you are familiar with the internet search feature, why not search for the answer?

http://www.google.com/search?q=upload+and+store+images+as+file+php

BTW, I do both both : save images in a database and as file. Depending on my needs I retrieve one or the other. Works fine.
 
Back
Top