Re: Insert a file in a mysql database!

From: Date: Tue, 06 Mar 2001 01:13:19 +0000
Subject: Re: Insert a file in a mysql database!
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7129@lists.php.net to get a copy of this message
check in the manual under the features section, a part called Handling file uploads. you need to use a multipart/form-data html form, which then posts the contents of the file to the server. once it is there, you can parse it into a single variable and save that into the db just like you would anything else, or you can write it to disk somewhere and save a path for it. getting it back out - make sure you also save the mime-type of the file, then just pass the mimetype as a header, and then spit out the contents of the file (if it's saved in the db) HTH Beau At 01:03 PM 3/3/01 -0800, Pedro M. S. Oliveira wrote:
Hi all... Here i am once again asking for advice :) well i need to put a file (something lika *.doc or *.rtf) on a mysql database. The thing is: the user need to upload a computer file to the mysql runing over a linux box. i would like to know: 1) what is the best way to do this? 2) what is the html code i have to generate do do this? 3) how can i read this back from the database? i read something about sending the file over ftp and then on the database put just the path to the file. but what is your opinion? thankx ******************************************* Pedro Miguel Silva Oliveira Cell Phone: +351 96 5867227 SMS: 965867227@mail.tmn.pt Email: Oliveira.Pedro@bigfoot.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
-- Beau Lebens - Web Master Insurance My Way, Your Friendly Online Broker (08) 9226 5888 http://www.insurancemyway.com.au/

« previous php.db (#7129) next »