使用範例:
upload.php
include_once "upload.class.php";
if ($Submit != '')
{
$fileArr[ file'] = $file;
$fileArr['name'] = $file_name;
$fileArr['size'] = $file_size;
/**所允許上傳的文件類型*/
$filetypes = array('gif','jpg','jpge','png');
$savepath = "/usr/htdocs/upload/";
/**文件上傳目錄*/
$maxsize = 0;
;
$upload = 新上傳($fileArr, $file_name, $savepath, $filetypes, $overwrite, $maxsize);
if (!$upload->run())
if (!$upload->run())
if (!$upload->run())
echo "上傳失敗".$upload->errmsg();
}
}
?>