diff --git a/elfinder/sftpstoragedriver/sftpstorage.py b/elfinder/sftpstoragedriver/sftpstorage.py index dc1932e8..f833556f 100644 --- a/elfinder/sftpstoragedriver/sftpstorage.py +++ b/elfinder/sftpstoragedriver/sftpstorage.py @@ -231,7 +231,6 @@ def read(self, num_bytes=None): if not self._is_read: self.file = self._storage._read(self._name) self._is_read = True - return self.file.read(num_bytes) def write(self, content): diff --git a/elfinder/volumes/storage.py b/elfinder/volumes/storage.py index a748fc63..f2cfb0d1 100644 --- a/elfinder/volumes/storage.py +++ b/elfinder/volumes/storage.py @@ -223,8 +223,14 @@ def _stat(self, path): """ stat = {} + # fix sftp link not exist can not open bug if not self._options['storage'].exists(path): - raise os.error + stat['size'] = 'unknown' + stat['mime'] = 'symlink-broken' + stat['read'] = False + stat['write'] = False + return stat + # raise os.error try: stat['mime'] = self.mimetype(path)