Encode an image and pass it to a database


What am I doing wrong !