Hi,
I'm loving the new uploadify module but I'm having a problem uploading documents via the FileDataObject manager (specifically PDFs and Doc files). Images (JPEGs) work absolutely fine however. If I try to select a document the progress bar jumps immediately to 100% and reports 'HTTP Error.'
Any help would be much appreciated! Below is the code in question:
<document.php>
class Document extends DataObject {
static $db = array (
'Name' => 'Text',
'Description' => 'Text',
'Category'=> "Enum('Letters, Curriculum Maps, General')"
);
static $has_one = array (
'Attachment' => 'File',
'DocumentsPage' => 'DocumentsPage'
);
public function getCMSFields_forPopup()
{
return new FieldSet(
new TextField('Name'),
new TextField('Description'),
new DropdownField('Category','Category', singleton('Document')->dbObject('Category')->enumValues()),
new FileIFrameField('Attachment')
);
}
}
<documentspage.php>
class DocumentsPage extends Page {
static $has_many = array (
'Documents' => 'Document'
);
static $allowed_children = array('Document');
static $default_child = 'Document';
public function getCMSFields()
{
$fields = parent::getCMSFields();
$manager = new FileDataObjectManager(
$this,
'Documents',
'Document',
'Attachment',
array(
'Name' => 'Name',
'Description' => 'Description',
'Category' => 'Category'
),
'getCMSFields_forPopup'
);
$fields->addFieldToTab("Root.Content.Documents",$manager);
return $fields;
}
}