I am trying to use upload images it works perfect in browser but it doesn't work in iphone and ipad .below are code and screenshots for iphone
test.php
---------
<?php
if(isset($_POST['submit']))
{
//echo "<pre>";
//print_r($_FILES);
//exit;
copy($_FILES["image1"]["tmp_name"],"upload/".$_FILES["image1"]["name"]);
copy($_FILES["image2"]["tmp_name"],"upload/".$_FILES["image2"]["name"]);
copy($_FILES["image3"]["tmp_name"],"upload/".$_FILES["image3"]["name"]);
echo "Stored in: " . "upload/" . $_FILES["image1"]["name"];
echo "<br>";
echo "Stored in: " . "upload/" . $_FILES["image2"]["name"];
echo "<br>";
echo "Stored in: " . "upload/" . $_FILES["image3"]["name"];
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>demo</title>
</head>
<body>
<form method="post" enctype="multipart/form-data">
image 1 : <input type="file" name="image1" ><br/>
image 2 : <input type="file" name="image2" ><br/>
image 3 : <input type="file" name="image3" ><br/>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
iphone screenshot
As we can see from this below array this is displayed in iphone/ipad the image names are same for all and when i try to check for upload folder it displayed only the last image i.e third image .
[image1] => Array
(
[name] => image.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpewhdwx
[error] => 0
[size] => 44009
)
[image2] => Array
(
[name] => image.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpwYDYBM
[error] => 0
[size] => 27762
)
[image3] => Array
(
[name] => image.jpg
[type] => image/jpeg
[tmp_name] => /tmp/php0vqnB2
[error] => 0
[size] => 32961
)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…