List:General Discussion« Previous MessageNext Message »
From:<sinisa Date:July 20 1999 1:13pm
Subject:Saving & Loading Images...
View as plain text  
Nolberto Rojas Gil writes:
 > Sorry for my English in advance:
 >     I wonder if someone can say how to insert image files into mysql and how to load
 > them using "C" or "Java" ?
 > 
 > I you send me a part of source code i´ll appreciate you infinitely.
 > 
 > Thanks  a lot
 > 
 > --
 > _________________________________________________________________
 > "La diferencia entre "querer" y "amar" es en verdad muy grande;
 > es la diferencia que hay entre la luciérnaga y la luz "
 > 
 > Norberto Rojas, a quien ya se le prendió el foco.
 > _________________________________________________________________
 > 
 > _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 > _/    Ing. Nolberto Rojas Gil               _/
 > _/    Jefe de Proyectos y                   _/
 > _/    Servicios de Internet                 _/
 > _/    Centro estatal SICOM                  _/
 > _/     Blvd. San Felipe #2615-B             _/
 > _/     Col. Rancho Colorado                 _/
 > _/     C.P.: 72040                          _/
 > _/     Puebla,Pue; México                   _/
 > _/     Tel: 52 22 300057 ext. 283           _/
 > _/     Fax: 55 22 300058 ext. 260           _/
 > _/     E-mail: nrojas@stripped       _/
 > _/                webmaste@stripped  _/
 > _/     http://www.sicomnet.edu.mx/~nrojas   _/
 > _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 > 

Hi Nolberto !

Regarding C, there is an example in contrib pages called hylalog. This 
happens to be one of the first programs I wrote using MySQL. This
program in the module FaxSendAPP.c++ stores entire faxes, which are
TIFF images in a single column.

Basic principle is rather simple. You use BLOB field types, and when
you save the image, you first escape it using escape C++ stream
operator or mysql_escape_string function from mysql library. When you
fetch your image, you DO NOT unescape it. You get the image from BLOB
in a binary form, and get the size from the result set.

BTW, Paul DuBois has written a wonderful chapter on the subject in the 
manual that comes with MySQL.

Read it.

Sinisa

+----------------------------------------------------------------------+
| TcX  ____  __     _____   _____  ___     ==  mysql@stripped            |
|     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sinisa Milivojevic          |
|    /*/ /*/ /*/   \*\_   |*|   |*||*|     mailto:sinisa@stripped|
|   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Larnaka, Cyprus             |
|  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____                             |
|  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^                            |
|             /*/             \*\                Developers Team       |
+----------------------------------------------------------------------+
Thread
Followup on symlinking database directoriesPaul DuBois18 Jul
  • Followup on symlinking database directoriessinisa19 Jul
    • Re: Followup on symlinking database directoriesPaul DuBois19 Jul
      • Re: Followup on symlinking database directoriessinisa19 Jul
        • Re: Followup on symlinking database directoriesPaul DuBois19 Jul
          • Re: Followup on symlinking database directoriessinisa19 Jul
            • Re: Followup on symlinking database directoriesPaul DuBois19 Jul
              • Re: Followup on symlinking database directoriessinisa20 Jul
            • Re: Followup on symlinking database directoriesMichael Hase19 Jul
              • Saving & Loading Images...Nolberto Rojas Gil19 Jul
                • Saving & Loading Images...sinisa20 Jul