我正在使用uploadify,雖然它的工作原理它並沒有上傳到文件夾中。我怎樣才能讓它複製?該文件夾是777uploadify工作但沒有上傳到文件夾
這裏是如果需要的頁面:
http://www.dilyurdu.com/uploadify/
//腳本
$(function() {
$("#file_upload_1").uploadify({
height : 30,
swf : 'uploadify.swf',
uploader : 'uploadify.php',
width : 120
});
});
// PHP
$targetFolder = '/uploads'; // Relative to the root
if (!empty($_FILES)) {
$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.';
}
}
它說調用未定義的函數base_url() – user1425871 2012-07-27 11:32:39
@ user1425871:base_url是我定義的函數給你的路徑在那裏。 – Vamsi 2012-07-27 11:45:13
確定它已經工作。但是,文件的最大大小是否有限制? – user1425871 2012-07-27 11:49:02