How to insert simultanously an image and document in my database

I would insert by code and image, and document simultanously