uploadify는 작동하지만 폴더로 업로드하지는 않습니다. 복사하려면 어떻게해야합니까?uploadify는 작동하지만 폴더에 업로드하지 않습니다.
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
@ user1425871 : base_url은 내 경로로 정의 된 함수입니다. – Vamsi
확인되었습니다. 하지만 파일의 최대 크기 제한이 있습니까? – user1425871