Re: need help with uploading images
| From: | Oscar F | Date: | Sun, 28 Jul 2002 22:20:29 +0000 |
| Subject: | Re: need help with uploading images | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110071@lists.php.net to get a copy of this message | ||
deadsman,
if (($filename_type != "image/jpeg") && ($filename_type != "image/jpg")
&&
($filename_type != "image/pjpeg")) {
header("Location:submitError.php"); exit; //goes to an error page if the
file wasnt a jpg
} else {
$upload_path = "/path/of/the/$filename_name";
if (is_uploaded_file($filename)) {
Exec("cp $filename $upload_path");
} else {
//do whatever if it wasnt uploaded
}
The "file" formfield, is called filename.. just in case... if you call it
myFile, you'd have to replace $filename with that.
Hope this helps.
Oscar.-
----- Original Message -----
From: "Deadsam" <deadsam@sympatico.ca>
To: <php-general@lists.php.net>
Sent: Sunday, July 28, 2002 5:53 PM
Subject: [PHP] need help with uploading images
> I'm trying to get an uploader to work, where you check to make sure it's a
> jpeg file that's being uploaded, and no other files allowed. the server is
> unix linux using php4.1
> Any help would be appreciated.
> thanks in advance
> deasdam
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>