Re: linking images

From: Date: Tue, 01 May 2001 03:46:44 +0000
Subject: Re: linking images
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-9007@lists.php.net to get a copy of this message
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 <IMG SRC=""> or <A HREF =""> like > this: <A HREF="image_folder/<? echo $filename ?>"> > > HTH, > probably a bit confusing, lemme know if you would like > my script. > > olinux > > --- Sharmad Naik <sharmad@goatelecom.com> 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: > > php-db-unsubscribe@lists.php.net > > For additional commands, e-mail: > > php-db-help@lists.php.net > > To contact the list administrators, e-mail: > > php-list-admin@lists.php.net > > > > __________________________________________________ > 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: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#9007) next »