AJAX 客户端页面代码: index.html
[复制此代码]CODE:
Ajax file upload sample
PHP服务器端代码: upload.php
[复制此代码]CODE:
// $_FILES['photofile']:是获得上传图片的数组
// $uploadfile:存放地址
$uploadfile = "D:/".$_FILES['photofile']['name'];
copy( $_FILES['photofile']['tmp_name'], $uploadfile );
echo "URL:
".$_FILES['photofile']['name']."";
?>
Upload successed!
本文来自: 脚本之家() 详细出处参考:
阅读(3957) | 评论(1) | 转发(0) |