XLS file gets transformed to .doc document on production environment. Symfony 1.4
I am trying to upload a XLS file with my Symfony 1.4 webapplication. However on the production environment t开发者_如何学Che behaviour regarding handling a XLS file is different then on the development environment.
Development environment: Windows 7, 64 AppServ 2.5.10. PHP version 5.2.6 Production environment: Linux Redhat. Apache 2.2.3 (CentOS). PHP version 5.2.17
The problem is that on the production environment an uploaded XLS file is written as a .DOC file. On the development everything works just fine. XLS gets written as XLS.
This problem only occurs with XLS files. XLSX, DOC and other files are handled correctly on both environments.
Following code is used in upload form:
$this->widgetSchema['file'] = new sfWidgetFormInputFileEditable(array(
'label' => 'File',
'file_src' => $this->getObject()->getFile() ? '/uploads/documents/'.$this->getObject()->getFile() : '',
'is_image' => false,
'edit_mode' => !$this->isNew(),
'delete_label' => $this->getObject()->getTitle(),
'template' => '<div><a href="%file%" target="_blank">%delete_label%</a><br />%input%<br />%delete% Delete current file</div>',
));
$this->setValidator('file', new sfValidatorFile(array(
'mime_types' => array(
'image/jpeg',
'image/pjpeg',
'image/png',
'image/x-png',
'image/gif',
'application/msword',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/pdf',
'application/x-pdf',
'application/x-gzip',
'application/zip',
'application/x-zip',
'application/msexcel',
'application/vnd.ms-excel',
'application/mspowerpoint',
'application/rtf',
'text/plain'
),
'path' => sfConfig::get('sf_upload_dir').'/documents/',
'required' => false
)));
Anyone experienced this same behaviour with symfony 1.4?
精彩评论