Jump to content

error uploading image using php


prakash

Recommended Posts

Hi

 

I am using following condition to upload image from php.

 

if (($_FILES["somefile"]["type"] == "image/jpg") || ($_FILES["somefile"]["type"] == "image/jpeg") || ($_FILES["somefile"]["type"]  == "image/pjpeg")) {
// correct image type
} else {
// print wrong image type
}

 

I want a condition to upload only jpg image but this code doesn't works on all jpg images.

 

can anyone give me an idea what may be the cause / is the condition correct?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/143131-error-uploading-image-using-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.