$file_size_max) { echo "對不起,你的文件容量大於規定"; exit; } // 檢查讀寫文件 if (file_exists($store_dir.$upload_file_name) && !$accept_overwrite) { echo "文件已存在,不能再複製"; //複製文件到指定目錄 if copy($upload_file, $store_dir.$upload_file_name)) { echo "複製文件失敗"; echo "上傳文件完成"; ?>"> $file_size_max) { echo "對不起,你的文件容量大於規定"; exit; } // 檢查讀寫文件 if (file_exists($store_dir.$upload_file_name) && !$accept_overwrite) { echo "文件已存在,不能再複製"; //複製文件到指定目錄 if copy($upload_file, $store_dir.$upload_file_name)) { echo "複製文件失敗"; echo "上傳文件完成"; ?>">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

檔案上傳 <form method=post action="upload.php" ENCTYPE="multipart/form-data"> <input type="file" name="upload_file"> <input type="submit" name="submit" value="上傳文件">

Similar presentations


Presentation on theme: "檔案上傳 <form method=post action="upload.php" ENCTYPE="multipart/form-data"> <input type="file" name="upload_file"> <input type="submit" name="submit" value="上傳文件">"— Presentation transcript:

1 檔案上傳 <form method=post action="upload.php" ENCTYPE="multipart/form-data"> <input type="file" name="upload_file"> <input type="submit" name="submit" value="上傳文件">

2 檔案上傳 <? $file_size_max = 1000000; // 限制文件上傳最大容量(bytes)
$store_dir = "./database/"; // 上傳文件的儲存位置 $accept_overwrite = false; //允許讀寫文件 // 檢查文件大小 if ($upload_file_size > $file_size_max) { echo "對不起,你的文件容量大於規定"; exit; } // 檢查讀寫文件 if (file_exists($store_dir.$upload_file_name) && !$accept_overwrite) { echo "文件已存在,不能再複製"; //複製文件到指定目錄 if copy($upload_file, $store_dir.$upload_file_name)) { echo "複製文件失敗"; echo "上傳文件完成"; ?>


Download ppt "檔案上傳 <form method=post action="upload.php" ENCTYPE="multipart/form-data"> <input type="file" name="upload_file"> <input type="submit" name="submit" value="上傳文件">"

Similar presentations


Ads by Google