Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Is it better to store images in a blob or just the url?

I need to recover images from an XML file stored on a remote server and save it to my database. Not sure how I should do so though, what type of field should the image be stored in?


share|improve this question

migrated from Aug 15 '11 at 23:26

This question came from our site for professional and enthusiast programmers.

marked as duplicate by jcolebrand Aug 15 '11 at 23:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

This was migrated from Stack Overflow as being a duplicate of several questions here, and closed for the same reason. There has been a lot of excellent advice already given on this topic, I encourage you to read that advice. Do a search for image on this site ;) – jcolebrand Aug 15 '11 at 23:27

You can store your images as blobs, but in practice you're usually better off storing them in the file system and just keeping the paths to the images in the database.

See: MySQL Docs: BLOB datatype

share|improve this answer

You would just store the src in a varchar field, if using php do a file get contents function and use the awesome string functions to parse the file.

share|improve this answer
Yeah you could. But the question is how to store the files in the database and what type of field to use. – ypercubeᵀᴹ Aug 15 '11 at 23:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.