You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2016-09-26 09:09:29

glpi.al
Member
Registered: 2012-10-16
Posts: 78

docx and xlsx documents as zip

Hi,
in GLPI (I've 0.85.4), the docx and xlsx documents are uploaded ad zip in the mime type.
For this reason they are not correctly open as document from the users.
On Internet I found that this is correct because:

"docx is a zipped xml-format and thats the reason, why file_info() returns application_zip (what is completely right)"


To workaround, in the document.class.php file I add:

      // Local file : try to detect mime type

//docx xlsx workaround for finfo_file($finfo, $fullpath);

if (substr(finfo_file($finfo, $fullpath), 12, 3) == 'zip') {
$input['mime'] = '';
}

to reset the mime type for zip file.
Now the docx/xlsx open correctly. Is there another solution that could be integrated in GLPI?

Best Regards.

Offline

Board footer

Powered by FluxBB