How to save BMP in database?

Closed due to the fact that the issue is too common for Aries , ermak0ff , Visman , aleksandr barakin , Max Mikheyenko participants on Oct 10 '15 at 17:16 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

    2 answers 2

    Why store BMP in a database if you can store a link to BMP in the database, and keep the BMP in some file storage? For example, DropBox.

    If you tell for what purpose you are going to store files, then perhaps people will tell you a more suitable option for you.

    PS: I hope BMP is still a picture, and not something that did not come to my mind.

      1. Translate the image into an array of bytes.
      2. Store an array of bytes in the database.

      Example:

      INSERT INTO SOME_TABLE (IMAGE_BYTES) VALUES (@image_bytes) 

      where through the parameter you give your picture in @image_bytes.

      • one
        For the web is not the preferred option. - Oleg Arkhipov