Inserting Blobs

I'm using the Perl DBI interface to access a MySQL server, query it, insert data etc, and it's going great...however there is one thing I cannot work out. I know you can store huge amounts of data in the database, using the Blob data types, but what I need to know is how to insert this data? Putting it in a normal insert, e.g.

Comments

: Hi,: : I'm using the Perl DBI interface to access a MySQL server, query it, insert data etc, and it's going great...however there is one thing I cannot work out. I know you can store huge amounts of data in the database, using the Blob data types, but what I need to know is how to insert this data? Putting it in a normal insert, e.g.: : $dbh->do(qq{: INSERT INTO people (name, image) VALUES('$name', '$image'): });: : Where $image contains an uploaded image, just doesn't work! So how exactly is it done?

do you have the ability to upload files through the browser to your server and then changing the name on them? because if you can maybe you should upload the images as a file into a special folder and change the name on it to something like abc123 so it will have a unique name (every picture) and then just entering the name of the file in the db[red]--[/red][green]jcarlsson[/green] [blue]<[/blue][purple]jcarlsson@linux.nu[/purple][blue]>[/blue][red]http://www.jcarlsson.tk[/red]

Yes, I know you can do this - this is my current workaround. I'm just after the real solution, if you know what I mean.

Thanks a lot anyway!

Jonathan

: : Hi,: : : : I'm using the Perl DBI interface to access a MySQL server, query it, insert data etc, and it's going great...however there is one thing I cannot work out. I know you can store huge amounts of data in the database, using the Blob data types, but what I need to know is how to insert this data? Putting it in a normal insert, e.g.: : : : $dbh->do(qq{: : INSERT INTO people (name, image) VALUES('$name', '$image'): : });: : : : Where $image contains an uploaded image, just doesn't work! So how exactly is it done?: : : do you have the ability to upload files through the browser to your server and then changing the name on them? because if you can maybe you should upload the images as a file into a special folder and change the name on it to something like abc123 so it will have a unique name (every picture) and then just entering the name of the file in the db: [red]--[/red]: [green]jcarlsson[/green] [blue]<[/blue][purple]jcarlsson@linux.nu[/purple][blue]>[/blue]: [red]http://www.jcarlsson.tk[/red]: :

: Yes, I know you can do this - this is my current workaround. I'm just after the real solution, if you know what I mean.

if I don't remember this wrong, many of the bigger communities use this method, but some of them use other methods aswell, maybe you can find a script for placing images in a db somewhere on the internet, I don't realy know about that but I know that you can find very much on the internet if you look at the right place[red]--[/red][green]jcarlsson[/green] [blue]<[/blue][purple]jcarlsson@linux.nu[/purple][blue]>[/blue][red]http://www.jcarlsson.tk[/red]