Re: [PHP-DB] linking images
What field type do you use for stroing pictures? If not BLOB, you should try it. I haven't got a lot experience in it, but if you 'd like I 'll post some messages from the postgres mailing list to discover how it may be used. BLOBS are really useful , you can store some MBs in a field using BLOB type. I think it is quite enough for you :) - Original Message - From: "Sharmad Naik" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: 2001. április 30. 16:05 Subject: [PHP-DB] linking images > I m using postgresql-7.0.2 with php,My problem is that this database > doesn't allow more than 4k images to be stored . > I wanted to know how to store images in a > directory and keep its link in the dbase or if anyone can tell me how to split > the image so that it can be kept in the dbase > -Thanks > -- > The secret of the universe is @*&í!'ñ^#+ NO CARRIER > ___ _ _ _ > |_|_||_||_||\/||_|| \ > _|| || || \| || ||_/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] linking images
And store the file type - it does make a difference when you go to display it..i.e. *.gif or *.jpg.. Phil J. olinux o wrote: > Best way to do it is to store the filename in the db, > faster and really simple. > > What I have done at my site is write a script that > uploads the file. Uploading generates something like > three variables [filesize, filetype, and filename] the > only one I am concerned with is filename. The > variables are named the same as the file upload > fieldname plus an extension like this: > > say my upload field is NAME="upload_image" when i > upload the filename can be referenced by > upload_image_name - size by upload_image_size at least > from what i can remember quickly. > > so i insert this filename [upload_image_name] into a > table that references the associated ID. something > like this: > > IMG_TABLE > > apartment_id filename > > k, so this will store the filename, now you just need > to grab the filename from this table and echo the > filename into the or like > this: > > HTH, > probably a bit confusing, lemme know if you would like > my script. > > olinux > > --- Sharmad Naik <[EMAIL PROTECTED]> wrote: > > I m using postgresql-7.0.2 with php,My problem is > > that this database > > doesn't allow more than 4k images to be stored . > > I wanted to know how to store images in a > > directory and keep its link in the dbase or if > > anyone can tell me how to split > > the image so that it can be kept in the dbase > > -Thanks > > -- > > The secret of the universe is @*&í!'ñ^#+ NO CARRIER > > ___ _ _ _ > > |_|_||_||_||\/||_|| \ > > _|| || || \| || ||_/ > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > __ > Do You Yahoo!? > Yahoo! Auctions - buy the things you want at great prices > http://auctions.yahoo.com/ > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] linking images
Binary Large Objects permit storage of any operating system file, including images or large files directly into the database, Use lo_import() to load an object into the database and lo_export() to retrieve. CREATE TABLE picture(name char(20), photo OID); -- as an example. The lo_import() stores a path, i.e., /../...jpg and so on, into the database. The function call returns an OID that is used to refer to the imported large object. It is stored in picture.photo thus: INSERT INTO picture VALUES ('blabla', lo_import('/directory path/..jpg')); To retrieve it do: SELECT lo_export(picture.photo, '/export path, i.e., /tmp/outimage.jpg') FROM picture WHERE name = 'blabla'; Robert B. Barrington GetMart Commercial Ecom: Web Administrator http://weddinginlasvegas.com/ http://getmart.com/ [EMAIL PROTECTED] Vegas Vista Productions 3172 North Rainbow Boulevard Suite 326 Las Vegas, Nevada 89108-4534 Telephone: (702)656-1027 Facsimile: (702)656-1608 -Original Message- From: Sharmad Naik [mailto:[EMAIL PROTECTED]] Sent: Monday, April 30, 2001 7:06 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] linking images I m using postgresql-7.0.2 with php,My problem is that this database doesn't allow more than 4k images to be stored . I wanted to know how to store images in a directory and keep its link in the dbase or if anyone can tell me how to split the image so that it can be kept in the dbase -Thanks -- The secret of the universe is @*&í!'ñ^#+ NO CARRIER ___ _ _ _ |_|_||_||_||\/||_|| \ _|| || || \| || ||_/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] linking images
Best way to do it is to store the filename in the db, faster and really simple. What I have done at my site is write a script that uploads the file. Uploading generates something like three variables [filesize, filetype, and filename] the only one I am concerned with is filename. The variables are named the same as the file upload fieldname plus an extension like this: say my upload field is NAME="upload_image" when i upload the filename can be referenced by upload_image_name - size by upload_image_size at least from what i can remember quickly. so i insert this filename [upload_image_name] into a table that references the associated ID. something like this: IMG_TABLE apartment_id filename k, so this will store the filename, now you just need to grab the filename from this table and echo the filename into the or like this: HTH, probably a bit confusing, lemme know if you would like my script. olinux --- Sharmad Naik <[EMAIL PROTECTED]> wrote: > I m using postgresql-7.0.2 with php,My problem is > that this database > doesn't allow more than 4k images to be stored . > I wanted to know how to store images in a > directory and keep its link in the dbase or if > anyone can tell me how to split > the image so that it can be kept in the dbase > -Thanks > -- > The secret of the universe is @*&í!'ñ^#+ NO CARRIER > ___ _ _ _ > |_|_||_||_||\/||_|| \ > _|| || || \| || ||_/ > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]