使用 HTML 进行客户端图像处理
对于客户端处理和上传,您可以尝试运行以下代码 −
<?php if (isset($_FILES["image"])) { $ iSize = getimagesize($_FILES["image"]["tmp_name"]); if ($iSize!== false) { $myFile = "/tmp/" . basename($_FILES["image"]["name"]); if (move_uploaded_file($_FILES["image"]["tmp_name"], $myFile)) { echo "File stored at " . $myFile; } else { echo "Image storage failed!"; } } else { echo "This isn’t an image!"; } } else { echo "Image not available to upload!"; } ?>
广告