خرید بک لینک
Hi all,

I am using PHP to allow users to upload images to my website. The script I have works great from my Mac but I run into problems when attempting to upload photos from an iPhone.

Images from an iPhone fail this:

Code:

// Check if image file is a actual image or fake image
$check = getimagesize($_FILES["$ImageNumber"]["tmp_name"]);
if($check !== false) {
    $uploadOK = 1;
} else {
    $uploadOK = 0;
}

And if I remove the above check, the images then fail this:

Code:

if (move_uploaded_file($_FILES["$ImageNumber"]["tmp_name"], $target_file)) {
    code here...
} else {
    echo "It failed";
}

I've googled and the only info I can seem to find addresses images from iPhones not being orientated the correct way upon upload.

PHP newbie (possibly obvious from the post...)

Any insight would be much appreciated :)

برچسب: نویسنده: آیلین رضوانی تاريخ: يکشنبه 10 دی 1396 ساعت: 9:38

صفحه بندی