From e59f5611602038d8ad9849e0fd2663839d7f628e Mon Sep 17 00:00:00 2001 From: jimmy201602 Date: Sun, 21 Apr 2019 19:19:41 +0800 Subject: [PATCH] fix sftp upload bug --- elfinder/sftpstoragedriver/sftpstorage.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/elfinder/sftpstoragedriver/sftpstorage.py b/elfinder/sftpstoragedriver/sftpstorage.py index bd3c5eb2..dc1932e8 100644 --- a/elfinder/sftpstoragedriver/sftpstorage.py +++ b/elfinder/sftpstoragedriver/sftpstorage.py @@ -237,10 +237,7 @@ def read(self, num_bytes=None): def write(self, content): if 'w' not in self._mode and 'a' not in self._mode: raise AttributeError("File was opened for read-only access.") - if isinstance(content, str): - self.file = BytesIO(content.encode()) - else: - self.file = BytesIO(bytes(content)) + self.file = BytesIO(bytes(content)) self._is_dirty = True self._is_read = True