标签:
前台代码:
<html> <head> <title>上传文件</title> </head> <body> <form enctype="multipart/form-data" action="upload.php" method="post"> <input type="file" name="uploadfile" /> <input type="submit" value="上传"/> </form> </body> </html>
后台代码:
<?php //上传单文件 require ‘HTTP/Upload.php‘; $upload = new HTTP_Upload(); $file = $upload->getFiles(‘uploadfile‘); if ($file->isValid()) { $file->moveTo(‘uploads/‘); echo ‘OK!‘; }else { echo ‘False!‘; } ?>
最终:
标签:
原文地址:http://www.cnblogs.com/KTblog/p/4988018.html