Re: Upload & View Image
| From: | Malte Fucks | Date: | Sat, 20 Jan 2001 11:39:32 +0000 |
| Subject: | Re: Upload & View Image | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81260@lists.php.net to get a copy of this message | ||
I think the PHP image functions aren't what this guy needs...
First thing : File Uploads
You have to make a form, including an <input type="file" name="yourfile">
tag, which refers to a php script like...
<?
if($file)
{
if(@copy($yourfile,"./$yourfile_name"))
{
echo "$yourfile_name was uploaded succesfully";
}
else echo "ERROR - UPLOAD ABORTED";
}
?>
$yourfile_size includes the size of the file in bytes, use an if-statement
to check if the picture-size fits your needs...
$yourfile_type includes... guess what... the file type..
this should solve the upload problem...
To control the size of an image is a matter of your HTML... do something
like
<img src="yourimage" width="40px" height="40px">. Its even
possible to
insert height and width-values in percent...