Excel and Word (.xlsx and .docx) document upload not working

Hi,

My system is running on SuiteCRM 7.12.6. It is a fresh installation but it seems that I cannot upload excel (xlsx) or word (docx) files under each module.

I can upload documents like xls, doc but no xlsx and docx files types.

What could be the issue? Thanks

That is pretty weird. I just tried that test case on a 7.12.6 (uploading a docx under a Note record) and it worked like a charm.

Maybe there’s some other software interfering - some browser security, an antivirus, or some other network security device.

EDIT: you can also check file size. Maybe it’s not the extension that causes it to fail, but rather if these files are larger than others and exceed post_max_size or upload_max_filesize in your php.ini settings.

Hi, I have two installations with 7.12.9 and by one installation I have the same Problem. I have fuggure out, if the Filename ends with extention .xlsx and .docx I’v got an HTTP ERROR 500.
So I can fix the Problem when I disable the Module “Documents” in the Search Settings. But this is not a graet solution, cause the search work not with “Documents” any more :frowning:

There are explicit security restrictions to loading uploading those kinds of files.

It is configurable. Search these forums

I did not find that setting under system settings.

Check out your allowed MIME types in cpanel hosting (or whatever hosting environment you’re in).

If your Excel (.xlsx) and Word (.docx) uploads aren’t working, a few things might be causing the issue. First, check if your files are too large. Sometimes, uploads can fail if they exceed the platform’s limit.

You might also want to make sure your internet connection is stable. If everything seems fine but the issue persists, try clearing your browser cache or using a different browser to see if that helps.I also found a helpful guide on MyExcelOnline’s blog about troubleshooting file upload issues. It provides valuable tips, especially if the files are corrupted, or the software needs an update.

I had the same problem with SuiteCRM 7.14.1
Using php 7.4: no problem, the upload is OK
Using php 8.2: upload not working. PHP error:
PHP Fatal error: Uncaught ValueError: version_compare(): Argument #3 ($operator) must be a valid comparison operator in /home/…/…/…/vendor/zf1/zend-xml/library/Zend/Xml/Security.php:172

Line 172 is: version_compare(PHP_VERSION, ‘5.6’, ‘gte’)
In fact, ‘gte’ is not correct.
In php 8.2, the only correct parameters are: < , lt , <= , le , > , gt , >= , ge , == , = , eq , != , <>,‘ne’
(See PHP: version_compare - Manual)
So I replaced line 172 by: version_compare(PHP_VERSION, ‘5.6’, ‘>=’)
and upload was OK

Interesting!
Is that backportable? What I mean, does the new version of the line also work well with PHP 7.4?

Yes, it is back portable and works with php 7.4.

Ok, good! :+1:

Do you want to create a PR proposing this change?

No: I don’t know how to do it. But you can do it !

I am in too many places already :sweat_smile:

I just noticed your change is in a 3rd party file, under vendor directory. So it’s not a matter of doing a PR for SuiteCRM, it’s for Zend-xml, but most likely they already fixed it and it’s a matter of SuiteCRM bumping our zend modules in composer.json to a newer version. Which requires testing…

You can surely open an Issue (it’s just typing text) no report the situation and alert the devs. That would be a nice help :+1:

1 Like

It has been corrected in

Change : version_compare(PHP_VERSION, ‘5.6’, ‘ge’)
‘ge’ in equivalent to ‘>=’