RE: [PHP-DB] Uploading file into database

From: Date: Wed, 11 Apr 2001 11:19:11 +0000
Subject: RE: [PHP-DB] Uploading file into database
Groups: php.db 
Request: Send a blank email to php-db+get-8481@lists.php.net to get a copy of this message
Hope this helps. Lisa <HTML> <HEAD> <TITLE></TITLE> </HEAD> <? $host=""; $user=""; $password=""; $dbasename=""; mysql_pconnect("$host","$user","$password") or die("Unable to connect to SQL server"); mysql_select_db("$dbasename") or die("Unable to select database"); ?> <? if ($submit) { $sql5 = "INSERT INTO images (img_id,img_src) VALUES(NULL,'$fupload_name')"; $result5 = mysql_query($sql5) or die("unable"); $file_dir = "file DIRectory goes here/pics"; $file_url = "URL of where pics will site on the web - http://someurl.com/pics"; if (isset($fupload )) { if ($fupload_type == "image/gif") { copy ($fupload, "$file_dir/$fupload_name") or die ("Couldn't copy"); } } } ?> <BODY BGCOLOR="#FFFFFF"> <FORM action="<? print $PHP_SELF?>" method="post" enctype="multipart/form-data"> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" VALUE="51200"> <INPUT TYPE="hidden" NAME="$fupload_name" VALUE="<? echo $fupload_name ?>"> <INPUT TYPE=file name="fupload" VALUE=""><BR> <INPUT TYPE="submit" NAME="submit" VALUE="Send File to Web Server"> </FORM> <A HREF="index.php" CLASS="content">Home page</A> </BODY> </HTML> -----Original Message----- From: Xsarus Internetdiensten [mailto:info@xsarus.nl] Sent: Wednesday, April 11, 2001 9:18 PM To: Lucio Stoco; php-db@lists.php.net Subject: Re: [PHP-DB] Uploading file into database No things of all!!!! Only upload the file, move to the right location and insert the file link (location path) into the database. READY! Bey, Daniel Kieviet Xsarus Internetservices Holland ----- Original Message ----- From: "Lucio Stoco" <coinfaex@cwb.matrix.com.br> To: <php-db@lists.php.net> Sent: Wednesday, April 11, 2001 4:11 AM Subject: Re: [PHP-DB] Uploading file into database > Have you done the file upload into the database? > I´m having some problem to put the file (like .doc or .xls) in a database... > I´m using 'text' field type, is it right? > > Do you have any example about it? > > Tks. > > ""Zeus"" <techzeus@pacific.net.sg> escreveu na mensagem > news:01e601c0c26e$6ccded80$735518d2@zeus... > I'm trying to do a filexchange script. > > Does anyone know how to upload a file into the database such that when I do > a 'select *' query, I can click on a link the download that file. > > > > > > -- > 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 > -- 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 (#8481) next »