Re: need help with uploading images
| From: | Deadsam | Date: | Sun, 28 Jul 2002 23:02:43 +0000 |
| Subject: | Re: need help with uploading images | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110073@lists.php.net to get a copy of this message | ||
Thanks oscar I'll give this a go, I tried just using filetype != image/jpeg
so mabey adding the rest will help , I read there was a problem with some
browser with uploading hopfully this will solve the problem.
much apprecatied
Deadsam
"Oscar F" <lists@webdevfm.com> wrote in message
news:002001c23684$fc68ba20$bc00a8c0@320jupiter...
> 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
> >
> >
> >
>