Skip to content

Commit

Permalink
fix elfinder server api 2.1 directory upload bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy201602 committed Feb 12, 2018
1 parent ec5b07c commit 525e000
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions elfinder/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ def _upload(self, target, FILES, html=False, upload_path=False):
directly, the :meth:`elfinder.connector.ElfinderConnector.execute`
method must be used.
"""

if isinstance(html, basestring):
html = int(html)

Expand Down Expand Up @@ -576,7 +575,7 @@ def _upload(self, target, FILES, html=False, upload_path=False):
try:
#if upload files number exceed 1 it will cause a weird bug,the connector can't find the target directory.
#This function will caused another bug,if the upload directory file name contains dot will cause the file upload to the wrong directory.
if len(all_[item]) >=1:
if len(all_[item]) >=1 and isinstance(upload_path,list) and target not in upload_path:
file_ = volume.upload(files[file_index], new_target)
else:
file_ = volume.upload(files[file_index], target)#This is a weird bug
Expand Down

0 comments on commit 525e000

Please sign in to comment.