I am using uploadify although it works it does not upload into the folder. How can I make it copy? The folder is 777.
here is the page if needed:
http://www.dilyurdu.com/uploadify/
// script
$(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.';
}
}
Try this
And also echo $targetPath in uploadify.php so that you can trace the path where it is being uploaded.