Upload Image to MySQL

hi, how would I go about Uploading an Image to MySQL?
LVL 2
SaLzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ivanov_GCommented:
how do you connect to mySQL database? BDE, ADO, dbExpress, Direct Access Components ?
0
Ivanov_GCommented:
if you are using ADO, and respectively TADOQuery or TADOImage, specify Field for the image and set its type to ftBlob. Then you have LoadFromFile and SaveToFile methods...
0
SaLzAuthor Commented:
DAC
0
Ivanov_GCommented:
Which DAC?

ZeosLib
http://www.zeoslib.net/

MySQL DAC
http://www.crlab.com/mydac

Or something else? Please clarify...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mohammed NasmanSoftware DeveloperCommented:
Hello
If you work with Table components use:

// to save to db
TBLOBField(MyTable.FieldByName('MyImg')).LoadFromFile(MyFileName);
//load from db
TBLOBField(MyTable.FieldByName('MyImg')).SaveToFile(MyFileName);

if you working with Query then use parameters to assign the value of the field

MyQuery.sql.text := ' insert ........ :MyImg);
// to save to db
MyQuery.ParamByName('MyImg').LoadFromFile(MyFileName);
//load from db
MyQuery.ParamByName('MyImg').SaveToFile(MyFileName);

Regards,
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.