Bij gebrek aan inspiratie waar dit moet komen, wat doe ik mis? Als ik iets wil uploaden krijg ik een error: IO Error...
uploadify.php:

<?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

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.';
	}
}
?>


Indexpagina:

<!DOCTYPE html>
<html>
<head>
	<title>My Uploadify Implementation</title>
	<link rel="stylesheet" type="text/css" href="uploadify.css">
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="jquery.uploadify-3.1.min.js"></script>
	<script type="text/javascript">
	$(function() {
		$('#file_upload').uploadify({
			'swf'      : 'uploadify.swf',
			'uploader' : 'uploadify.php'
			// Your options here
		});
	});
	</script>
</head>
<body>
<input type="file" name="file_upload" id="file_upload" />
</body>
</html>


Wat doe ik mis?

Groeten,
Olivier
Gebruik firebug in firefox om eventuele fouten in je js te onthullen of een aanverwante plugin
Firebug geeft geen foutmeldingen, daarmee dat ik het hier vraag :s
probeer het eens zo:

        $(function() {
            $('#file_upload').uploadify({
                'swf'      : 'uploadify.swf',
                'uploader' : 'uploadify.php',
                'removeCompleted' : true,
                'progressData' : 'speed',
                'fileSizeLimit' : '2MB',
                'fileTypeDesc' : 'Image Files',
                'fileTypeExts' : '*.gif; *.jpg; *.png; *.jpeg',
                'buttonText' : 'Afbeelding',
                'onUploadSuccess' : function(file, data, response) {
                    alert('The file ' + file.name + ' was successfully uploaded with a response of ' + response + ':' + data);
            },
                 'onUploadError' : function(file, errorCode, errorMsg, errorString) {
                    alert('The file ' + file.name + ' could not be uploaded: ' + errorString);
                },
                'onSelectError' : function() {
                alert('The file ' + file.name + ' returned an error and was not added to the queue. Maby incorrect filetype, only allow (gif, jpg, png, jpeg)');
            }
            });
        });


Kijk is wat hij hier zegt ?
Hoe staat de chmod van je upload map ?
Uploadify, breek me de bek niet open.
Ik heb het ook enige tijd in mijn CMS geimplementeerd gehad, maar door de wazigste dingen werkte het uploaden helemaal niet meer en kreeg ik ook onbegrijpelijke I/O errors, zonder dat ik iets aangepast had.

Een leuke onUploadError-event in bovenstaand voorbeeld van Marco kan helpen. Maar ik vind de support van Uploadify dermate bagger dat ik maar over ben gestapt op PLupload.

Reageren