Home  >  Article  >  php教程  >  PHP implements uploading files without page refresh

PHP implements uploading files without page refresh

大家讲道理
大家讲道理Original
2017-03-24 15:27:272162browse

html part

index.html

无刷新上传文件


PHP part

upload.php

 $maxSize) {
$result = 1;
} else if (!in_array($myfileType, $fileTypes)) {
$result = 2;
} elseif (is_uploaded_file($myfile['tmp_name'])) {
$toFile = $uploadDir . '/' . $myfile['name'];
if (@move_uploaded_file($myfile['tmp_name'], $toFile)) {
$result = 0;
} else {
$result = -1;
}
} else {
$result = 1;
}
}
?>

Related articles:

How to get thinkphp3.2.3 upload file path

Thinkphp3.2.3 Integrate phpqrcode to generate two Sample code sharing of QR code

PHP implements file upload without page refresh

Uses Html5 to implement asynchronous file upload, supports cross-domain, and has upload progress bar

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn