first i would like to do it as you said. store the pictures outside the
database. i develop jsp sites and my problem is that i dont know how to
upload a file per jsp. i thought storing the pictures in mysql is the
easier way to solve my problem. but if its not good  to store binary data
in the database directly if have to learn how to upload pictures via jsp :
-)

plz tell me if the following statement is correct (just for the fact i cant
find a solution for the problem in jsp at once)

insert into pictures (picturename,picturedata) values ("testpicture", "c:
\temp\testpicture.gif");

picturename is defined as char(50) - picturedatea is defined as blob

thx for help

bastian



 -------------------------------------------------------------------------- 
          Externe Mail    Werner Stuerenburg <[EMAIL PROTECTED]>           
          30.07.2001    12:02                                               
 -------------------------------------------------------------------------- 




An:   [EMAIL PROTECTED]
cc:   [EMAIL PROTECTED]

Thema:    Re: howto insert an image as blob?

Do it like any other insert, but care for special characters. In
php, you would wrap data with addSlashes() and remove them on
retrieval with stripSlashes().

But... you better not insert images into a table. Yes, you can do
it, but it is generally considered a bad idea. Read about it at
http://www.bitbybit.dk/mysqlfaq/ - if the images have to be
provided by users, use the upload functions of your system. php
for example has upload support built in.

Next you have to care for the appropriate write rights for those
files. These can be handled safely without compromising system
security. Store all data associated with the pictures in a table
except the picture itself, which should be taken care of by the
file sytem.

[EMAIL PROTECTED] schrieb am Montag, 30. Juli 2001, 11:35:42:

> hello,

> plz can someone tell me howto insert an image as blob into a table. i
have
> created a table with a blob column, but i dont know how to fill it with
> binary data like pictures e.g..

> thx

> bastian


> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)

> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



--
Herzlich
Werner Stuerenburg

_________________________________________________
ISIS Verlag, Teut 3, D-32683 Barntrup-Alverdissen
Tel 0(049) 5224-997 407 · Fax 0(049) 5224-997 409
http://pferdezeitung.de








---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to