diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index a61131401985dc74fa754fbd93cb0b6b2e74d73e..c554eaf19ee7485fbd37a680a67372826b0a7d53 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -45,6 +45,9 @@ class SMB extends Common {
 			if (!$this->root || $this->root[0] != '/') {
 				$this->root = '/' . $this->root;
 			}
+			if (substr($this->root, -1, 1) != '/') {
+				$this->root .= '/';
+			}
 		} else {
 			throw new \Exception('Invalid configuration');
 		}