Save ofImage data to database as a blob

I want to save an image to database using ofxHttpUtils so i should send the image as a string via an http POST request , and then save it with php script

ofImage img;
formIn.addFormField("image",IMG AS A STRING);

How can i get the image data and convert it to string. ?
or is there any other way to save an image directly to database …

Thanks in advance

Maybe you can convert the image into a base64 string and use that?
According to this thread you should be able to do this using the ofXIO addon .

you can also use void addFile(string fieldName, string path) in ofxHttpForm if the image is in a file

Thanks bro , it works well (y)