Download image to desktop from database

images php coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
Strider64
php-forum Active User
php-forum Active User
Posts: 315
Joined: Sat Mar 23, 2013 8:24 am
Location: Livonia, MI
Contact:

Sat Dec 10, 2016 2:44 pm

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.

AdoptiveSolution
New php-forum User
New php-forum User
Posts: 167
Joined: Wed Jun 15, 2016 8:35 am

Sun Dec 11, 2016 7:25 am

This page has code that shows how to store and retrieve images from a database :

https://phpro.org/tutorials/Storing-Ima ... h-PHP.html

AdoptiveSolution
New php-forum User
New php-forum User
Posts: 167
Joined: Wed Jun 15, 2016 8:35 am

Wed Dec 14, 2016 9:31 am

If you are familiar with the internet search feature, why not search for the answer?

http://www.google.com/search?q=upload+a ... s+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.

Post Reply