Skip to content

Commit

Permalink
fix sftp protocol link not exist bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy201602 committed Apr 21, 2019
1 parent e59f561 commit 5aa3e81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion elfinder/sftpstoragedriver/sftpstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
8 changes: 7 additions & 1 deletion elfinder/volumes/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5aa3e81

Please sign in to comment.