You can store images (or nearly any other kind of binary data) in a database.
However, I recommend against doing so, especially if you are programming for a web interface. I recommend storing your images on your filesystem, and storing just the filenames of your images in the database.
If you store your images in the database, when it comes time to display an image you will have to write the code to fetch the data, provide the correct content-type headers, and stream out the data. Why do all that when by fetching the name of the file from the database and making it available to the browser as an <IMG> tag, the web server can do all that for you?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.