Let me first say I think this is a wonderfull project! compliments to the designers!
Though I have implemented the uploadify by the instructions in the PDF-manual and it does not work..
When I point some files and let the script upload my pictures, the indication bars fill up and the script says nothing further..
When I look into my upload folder, defined in the parameters behind 'folder', I see no files uploaded..
The userrights on the uploadfolder are full on Everyone.
Does someone know wat I've been doing wrong?
script (form.php);
- Code: Select all
<input id="fileInput" name="fileInput" type="file" />
<script type="text/javascript">// <![CDATA[
$(document).ready(function() {
$('#fileInput').uploadify({
'uploader' : 'scripts/Service/Foto/uploadify.swf',
'script' : 'scripts/Service/Foto/uploadify.php',
'cancelImg' : 'scripts/Service/Foto/cancel.png',
'auto' : true,
'folder' : 'scripts/Service/Foto/uploads',
'buttonText': 'Bladeren...',
'multi' : true
});
});
// ]]>
</script>
uploadify.php;
- Code: Select all
<?php
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
//$targetPath = 'scripts/Service/Foto/Temp/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
//$fileTypes = str_replace('*.','',$_REQUEST['fileext']);
//$fileTypes = str_replace(';','|',$fileTypes);
//$typesArray = split('\|',$fileTypes);
//$fileParts = pathinfo($_FILES['Filedata']['name']);
//if (in_array($fileParts['extension'],$typesArray)) {
// Uncomment the following line if you want to make the directory if it doesn't exist
//if (!is_dir($targetPath)) {
// mkdir($targetPath);
//}
//echo $tempFile."<br />";
//echo $targetPath."<br />";
//echo $targetFile."<br />";
move_uploaded_file($tempFile,$targetFile);
echo "1";
// } else {
// echo 'Invalid file type.';
// }
}
?>
