Commit 11a365e9 authored by jimmy201602's avatar jimmy201602
Browse files

fix sftp protocol link not exist bug

parent 1886b6ba
Showing with 7 additions and 2 deletions
+7 -2
......@@ -231,7 +231,6 @@ class SFTPStorageFile(File):
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):
......
......@@ -223,8 +223,14 @@ class ElfinderVolumeStorage(ElfinderVolumeDriver):
"""
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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment