作者:Jasonscw | 来源:互联网 | 2018-04-24 01:36
本人初学uploadify上传,使用给的demo无法将文件上传到uploads文件夹内请各位大神给予指导index.php"<!DOCTYPEHTML>UploadiFiveTestbody{font:13pxArial,Helvetica,Sans-serif;}Uplo
phpupload
本人初学uploadify上传,使用给的demo无法将文件上传到uploads文件夹内 请各位大神给予指导 index.php
Uploadify Demo
upload
uploadify.php 上传处理文件 /* Uploadify Copyright (c) 2012 Reactive Apps, Ronnie Garcia Released under the MIT License http://www.opensource.org/licenses/mit-license.php */
// Define a destination $targetFolder = '/uploads'; // Relative to the root
$verifyToken = md5('unique_salt' . $_POST['timestamp']);
if (!empty($_FILES) && $_POST['token'] == $verifyToken) { $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder; $targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
// Validate the file type$fileTypes = array('jpg','jpeg','gif','png'); // File extensions$fileParts = pathinfo($_FILES['Filedata']['name']);if (in_array($fileParts['extension'],$fileTypes)) { move_uploaded_file($tempFile,$targetFile); echo '1';} else { echo 'Invalid file type.';}
} ?>