Take the 2-minute tour ×
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. It's 100% free, no registration required.

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?

Thanks!

share|improve this 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 ;) dba.stackexchange.com/search?q=image –  jcolebrand Aug 15 '11 at 23:27
add comment

migrated from stackoverflow.com 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.

2 Answers

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
add comment

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
add comment

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