PHP swfupload图片上传的实例代码

前端之家收集整理的这篇文章主要介绍了PHP swfupload图片上传的实例代码前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

PHP代码如下:

代码如下:
if (isset($_FILES["Filedata"]) || !is_uploaded_file($_FILES["Filedata"]["tmp_name"]) || $_FILES["Filedata"]["error"] != 0) {
$upload_file = $_FILES['Filedata'];
$file_info = pathinfo($upload_file['name']);
$file_type = $file_info['extension'];
$save = 'image/' . md5(uniqid($_FILES["Filedata"]['name'])) . '.' . $file_info['extension'];
$name = $_FILES['Filedata']['tmp_name']; if (!move_uploaded_file($name,$save)) {
exit;
} //将数组的输出存起来以供查看
$fileName = 'test.txt';
$postData = var_export($file_info,true);
$file = fopen('' . $fileName,"w");
fwrite($file,$postData);
fclose($file);
}

例包下载

原文链接:https://www.f2er.com/php/25620.html

猜你在找的PHP相关文章