uploading image to database

Status
Not open for further replies.

ginverted

New Member
Messages
11
Reaction score
0
Points
0
Im at the point I have to chose between displaying images from an ordinary folder or uploading and retreiving them from a database.

Yet, I can't decide which would be best keeping in mind storage size and security.

Ive read storing images in a database is more save, easy to move and backup. But takes more storage.

Also, are there any good tutorials on uploading and retreiving images from a database? I managed to decode the images to base64 and insert them into the database but I can't get them out and show them on my website.

Many thanks,
 

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Ive read storing images in a database is more save, easy to move and backup. But takes more storage.

Secure, probably
Easy to move, not really
Backup, yep.

It will also have an impact on the database in general as it will have to store BLOB data for your images. 1 or 2 wouldn't hurt but if you have 10000 50KB images, that adds it. It'll hurt the overall performance
 

Penguin129

New Member
Messages
68
Reaction score
0
Points
0
How would it be safer? If it's in a database, you still need to have a script to retrieve the data and act as an image. People would still be able to save the image and other things. I don't see any advantages over just using folders, except that browsing to the folder lists all the files, which can be remedied by placing an empty index file to prevent a directory listing.
 

ShannenName

New Member
Messages
5
Reaction score
0
Points
0
Or you could password protect the directory..or place the image folder outside /public_html (it could be www_html or htdocs depending on hosts) so people can't access it...
 

Penguin129

New Member
Messages
68
Reaction score
0
Points
0
If you password protect the directory, it will prevent people without the username and password to open it. The goal is to show it, not hide it..
 
Status
Not open for further replies.
Top