The PHP code is as follows:
Copy code The code is as follows:
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;
}
//Save the output of the array for viewing
$fileName = 'test.txt';
$postData = var_export($file_info, true);
$file = fopen('' . $fileName, "w");
fwrite($file,$postData);
fclose($file);
}
Example package download
http://www.bkjia.com/PHPjc/313521.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/313521.htmlTechArticleThe PHP code is as follows: Copy the code as follows: if (isset($_FILES["Filedata"]) || ! is_uploaded_file($_FILES["Filedata"]["tmp_name"]) || $_FILES["Filedata"]["error"] != 0) { $upload_f...