DW CS5 with PHP - page 317 - error?
This code:
$uploader->addValidator('MimeType', false, 'image');
Is throwing up this error:
The mimetype of file 'bryce2.jpg' could not been detected
I get the same error when using the completed script.
My full code at this stage is below:
<?php
if (isset($_POST['upload'])) {
require_once('library.php');
try {
$destination = 'C:/upload_test';
$uploader = new Zend_File_Transfer_Adapter_Http();
$uploader->setDestination($destination);
$uploader->addValidator('Size', FALSE, '50kB');
$uploader->addValidator('MimeType', false, 'image');
$uploader->addValidator('ImageSize', FALSE, array('minheight' => 500, 'minwidth' => 1000));
$success = $uploader->receive();
if (!$success) {
$messages = $uploader->getMessages();
} else {
$filename = $uploader->getFileName(NULL, FALSE);
$messages[] = "$filename uploaded successfully";
}
} catch (Exception $e) {
echo $e->getMessage();
}
}
