From: <sinisa Date: July 20 1999 1:13pm Subject: Saving & Loading Images... List-Archive: http://lists.mysql.com/mysql/7831 Message-Id: <14228.30181.377939.335830@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable 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" ? >=20 > I you send me a part of source code i=B4ll appreciate you infinitely= . >=20 > Thanks a lot >=20 > -- > _________________________________________________________________ > "La diferencia entre "querer" y "amar" es en verdad muy grande; > es la diferencia que hay entre la luci=E9rnaga y la luz " >=20 > Norberto Rojas, a quien ya se le prendi=F3 el foco. > _________________________________________________________________ >=20 > _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ > _/ 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=E9xico _/ > _/ Tel: 52 22 300057 ext. 283 _/ > _/ Fax: 55 22 300058 ext. 260 _/ > _/ E-mail: nrojas@stripped _/ > _/ webmaste@stripped _/ > _/ http://www.sicomnet.edu.mx/~nrojas _/ > _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ >=20 Hi Nolberto ! Regarding C, there is an example in contrib pages called hylalog. This=20= 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=20= manual that comes with MySQL. Read it. Sinisa +----------------------------------------------------------------------= + | TcX ____ __ _____ _____ ___ =3D=3D mysql@stripped = | | /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic = | | /*/ /*/ /*/ \*\_ |*| |*||*| mailto:sinisa@stripped= | | /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaka, Cyprus = | | /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ = | | ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ = | | /*/ \*\ Developers Team = | +----------------------------------------------------------------------= +