From: | "Zhidian Du" <duzhidian(at)hotmail(dot)com> |
---|---|
To: | pgsql-php(at)postgresql(dot)org |
Subject: | Are these steps correct and standard way to upload images into a table? |
Date: | 2002-11-08 04:32:00 |
Message-ID: | F90HfqR77bieLYCT4aJ00000036@hotmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-php |
I check the posts about uploading images from browser. No one give me a
whole procedure how to do it. My friend told me I can upload binary/image
file using following steps:
I want to know are these steps standard steps that insert images into a
table?
Step 1 upload it
<FORM METHOD=POST ACTION="" enctype="multipart/form-data">
<tr><td>upload </TD><TD><input type="file" name="pic"
size=40></td></tr></form>
<?
if($pic_name != '')
{
$len = strlen($pic_name)-4;
$ext = substr($pic_name,$len);
$ext = strtolower($ext);
$File="/www/pics/test".$ext;
exec("cp $pic $File");
}
?>
Step 2 Read it
$fd = fopen($img_name, "r");
while ($post_file = fread($fd, 4096))
{
$filestuff .= $post_file;
}
fclose($fd);
Step 3 insert or update into the table using insert or update
Are these steps correct or the standard way to upload images into a table?
Thanks.
Zhidian Du
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
From | Date | Subject | |
---|---|---|---|
Next Message | Chris Smith | 2002-11-08 04:45:54 | Re: Are these steps correct and standard way to upload |
Previous Message | Ray Hunter | 2002-11-07 22:57:05 | Re: Last URL |