Can't open files integrated in Nextcloud via the app "external storage support"

NethServer Version: 7.9.2009
Module: Nextcloud

Hi everybody,
I have some SMB shares stored on my nethserver which are integrated in nextcloud via the nextcloud app “external storage support”. Since the recent updates I can’t open any file stored on a smb share. I get messages like “Error loading xyz.jpg” when trying to open a picture or “Error in body stream” when trying to open a pdf file.
When I open a file which is stored in Nextcloud everything works fine. So it seems to me there’s an issue in the combination of smb, nextcloud and/or external storage support.

Does anyone have an idea how to figure out this problem?

Kind Regards


Hi Pete

The issue you’re describing is a known bug in Nextcloud and does concern External Storage using Samba in NC. See here:

The fix will probably come in one of the next updates. If you want to “fix” the issue until the fix is officially distributed, by all means. I did that also for myself / my clients and can confirm it works…

To replicate:

Backup your Server first, at least a config backup!

cp /usr/share/nextcloud/apps/files_external/3rdparty/icewind/smb/src/StringBuffer.php /usr/share/nextcloud/apps/files_external/3rdparty/icewind/smb/src/StringBuffer_Orig.php

nano /usr/share/nextcloud/apps/files_external/3rdparty/icewind/smb/src/StringBuffer.php

Edit the file according to the red highlighted line:

Save with CTRL-x, Confirm with y…

NC should work right away, it might make sense to restart apache (or just reboot the whole server).

My 2 cents


Hi Andy,
thanks for your reply.

As a quick solution I just installed apps on the mobile devices capable to connect to smb shares directly, this works for now. I’ll have to weigh if it’s worth to do the “fix” or to wait.