Home  >  Article  >  php教程  >  PHP 一个比较完善的简单文件上传

PHP 一个比较完善的简单文件上传

WBOY
WBOYOriginal
2016-06-13 12:18:02834browse

复制代码 代码如下:




文件上传



$UploadedFile=$_FILES['UploadedFile']['tmp_name'];
$UploadedFile_name=$_FILES['UploadedFile']['name'];
$isTrue=false;
if($UploadedFile)
{
$store_dir=$_SERVER['DOCUMENT_ROOT'];
$accept_overwrite = 1;
$isTrue=true;
}
$fileName = date("YmtHis").$UploadedFile_name;
if (file_exists($store_dir . $fileName))
{
echo "瀛
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