Home >php教程 >php手册 >文件上传类_php基础

文件上传类_php基础

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-17 09:12:52861browse

使用示例:
upload.php
include_once "upload.class.php";
if ($Submit != '')
{
    $fileArr['file'] = $file;
    $fileArr['name'] = $file_name;
    $fileArr['size'] = $file_size;
    $fileArr['type'] = $file_type;
    /** 所允许上传的文件类型 */
    $filetypes = array('gif','jpg','jpge','png');
    /** 文件上传目录 */
    $savepath = "/usr/htdocs/upload/";
    /** 没有最大限制 0 无限制*/
    $maxsize = 0;
    /** 覆盖 0 不允许  1 允许 */
    $overwrite = 0;
    $upload = new upload($fileArr, $file_name, $savepath, $filetypes, $overwrite, $maxsize);
    if (!$upload->run())
    {
     echo  "上传失败".$upload->errmsg();
    }
}
?>


文件上传





  
  




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