the industry better spot to upload images to? A database or perhaps in the net directory? And why?

You need to only store images inside your database for those who have a particular have to, like security, or as an absolute to-die-for have to keep all custom data inside a database.

Apart from that, getting large files into databases usually is not worthwhile. Storing and locating the file have that a lot more complicated to implement, and database updates/upgrades/conversions obtain that a lot more stuff that will go wrong.

I do not observe that there's a benefit storing images inside a database. There's no natural peace of mind in this. Files are for that filesystem so store your images inside.

I do not think you are able to "upload" a picture to some database. You are able to keep image's string value within the database and stream it via "header("Content-Type")" afterwards. That saves space inside your web server, but clearly takes space in your database.

Personally, I'd upload to some web directory, this way you will find the image for any regular URL request afterwards. Without having it inside a regular directory, you will need to connect with the database each time the look is asked for, and stream after that it.

Well It is dependent in your requirement. If you're thinking about security like a major problem then certainly you need to store it in db other smart there is little leads you to definitely store images in db.

Also retieving images from database is very complicated as with database images are saved as binary data. If you have specific need then only store images in database other smart storing images in directory could be fine.

As you can tell you will find a lot of reasons why to make use ofOrwhy don't you to make use of the database for image storage. Personally I favor to not make use of the database for storage of files (images, documents etc), except when I am purchased to keep them.

-Sometimes you are tired and ruin a question, something similar to "Choose * FROM images", this can get rid of the server if you will find a lot of images with huge size (2MB and much more) within the database. -The safety problem: you are able to still save the files within the disk but still be secure, how? Well save the files outdoors the net directory, whenever the file is asked for browse the file and create it for the consumer. -If by any chance you're using MySQL: in case your database has to large (say 2-3 GB), and you're simply utilizing a hosting that is shared, well best of luck making that backup or attempting to restore that image database.

It is simply my perspective