複製程式碼 程式碼如下:
無刷新檔案 " />
🀜 〜〜〜〜); $fileTypes = array('jpg','png','gif','bmp');
$result = null;
$uploadDir = './upfiles';
〜 $maxSize = 10 * 2,2,2,2,2,2,2,2,2,2,2,2, 2,22); if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['sub'])) {
$myfile = $_FILES['myfile'];
$myfileType = $_FILES['myfile'];
$myfileType = subname($myfile)[file' '], strrpos($myfile['name'], ".") + 1);
if ($myfile['size'] > $maxSize) {
$result = 1;
in } else in_ $myfileType, $fileTypes)) {
$result = 2;
} elseif (is_uploaded_file($myfile['tmp_name'])) {
mytoFile = $uploadD$toFile = $name ir . if (@move_uploaded_file($myfile['tmp_name'], $toFile)) {
$result = 0;
} else {
〜} $1; result = 1;
}
}
?>