Forums | Mahara Community
Artefact type of zip files seem to be wrong
23 July 2013, 2:42 AM
On my production site, uploaded zip files cannot be unzipped. On my test site they can. Checking the database entries I can see that on the test site the 'artefacttype' field is 'archive' and on the production site 'file' for exactly the same file.
ctime: 2013-07-22 14:51:43
mtime: 2013-07-22 14:51:43
atime: 2013-07-22 14:51:43
ctime: 2013-07-22 14:50:44
mtime: 2013-07-22 14:50:44
atime: 2013-07-22 14:50:44
Any idea why?
23 July 2013, 2:36 PM
When you upload a file, the file type that Mahara applies to it is based on:
1) The Mime Type that your browser thought the file was when it uploaded it, which means it can vary depending on what browser you were using
2) Or, if the browser provided no guess or described the file as "application/octet-stream", then Mahara falls back to using various PHP methods to make a best guess about the file type. These may vary depending on which server PHP is running on.
The logic for this is in htdocs/artefact/file/lib.php, ArtefactTypeFile::new_file() and htdocs/lib/file.php, function file_mime_type().
In particular, check if the PHP fileinfo library is installed on your prod site and your testing site. http://nz1.php.net/manual/en/fileinfo.installation.php