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:[EMAIL PROTECTED]]
Sent: Wednesday, April 11, 2001 9:18 PM
To: Lucio Stoco; [EMAIL PROTECTED]
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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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"" <[EMAIL PROTECTED]> escreveu na mensagem
> 01e601c0c26e$6ccded80$735518d2@zeus">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: [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]

Reply via email to