View Single Post

  #3 (permalink)  
Old 10-15-2007
lark
 
Posts: n/a
Default Re: Inserting a blob

== Quote from sophie_newbie (paulgeeleher@gmail.com)'s article
> Hi guys, I'm looking to insert a file, which was uploaded from a web
> form into a MySQL BLOB attribute in a database. The thing is I want to
> be able to do it without first having to write the file to disk. What
> I'm saying is that I don't want to use "INSERT INTO database (file)
> values ('/uploaddir/file.dat')"
> I know there must be another way of doing this because when I insert
> data as a BLOB in PhpMyAdmin, I see that it doesn't insert a file
> reference, rather a big long string that always starts with something
> like "0x1f7645.....". I'd like to know what this string means and how
> I can go about converting the uploaded files which are stored in
> memory to a string like this and attatch them to the database without
> having to write them to disk. The files are quite large so I want to
> avoid doing this.
> Thanks!



i think what you see in phpMyAdmin is a handle to a temporary file. the file has
to be written to disk, i believe before being inserted into the database. you can
also implement a way of writing to a temporary location and then insert to
database. Finally, you'd delete the file from disk.

--
POST BY: lark with PHP News Reader
Reply With Quote