Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
coco
Commits
6273dda7
Unverified
Commit
6273dda7
authored
Aug 19, 2019
by
BaiJiangJie
Committed by
GitHub
Aug 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #269 from jumpserver/websftp
[Bugfix] Upload file failed
parents
06bc2197
4f6e0055
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
sftp.py
coco/httpd/elfinder/volumes/sftp.py
+6
-4
No files found.
coco/httpd/elfinder/volumes/sftp.py
View file @
6273dda7
...
@@ -263,10 +263,10 @@ class SFTPVolume(BaseVolume):
...
@@ -263,10 +263,10 @@ class SFTPVolume(BaseVolume):
num
,
total
=
int
(
num
),
int
(
total
)
num
,
total
=
int
(
num
),
int
(
total
)
if
upload_path
and
len
(
upload_path
)
==
1
and
(
filename
in
upload_path
[
0
]):
if
upload_path
and
len
(
upload_path
)
==
1
and
(
filename
in
upload_path
[
0
]):
path
=
self
.
_join
(
parent_path
,
upload_path
[
0
]
.
lstrip
(
self
.
path_sep
))
path
=
self
.
_join
(
parent_path
,
upload_path
[
0
]
.
lstrip
(
self
.
path_sep
))
elif
upload_path
and
parent
==
upload_path
[
0
]:
elif
upload_path
and
parent
!=
upload_path
[
0
]:
path
=
self
.
_join
(
parent_path
,
filename
)
else
:
path
=
self
.
_join
(
parent_path
,
upload_path
[
0
]
.
lstrip
(
self
.
path_sep
),
filename
)
path
=
self
.
_join
(
parent_path
,
upload_path
[
0
]
.
lstrip
(
self
.
path_sep
),
filename
)
else
:
path
=
self
.
_join
(
parent_path
,
filename
)
remote_path
=
self
.
_remote_path
(
path
)
remote_path
=
self
.
_remote_path
(
path
)
if
num
==
0
:
if
num
==
0
:
infos
=
self
.
_list
(
os
.
path
.
dirname
(
path
))
infos
=
self
.
_list
(
os
.
path
.
dirname
(
path
))
...
@@ -290,8 +290,10 @@ class SFTPVolume(BaseVolume):
...
@@ -290,8 +290,10 @@ class SFTPVolume(BaseVolume):
def
upload_chunk_merge
(
self
,
parent
,
chunk
,
upload_path
):
def
upload_chunk_merge
(
self
,
parent
,
chunk
,
upload_path
):
parent_path
=
self
.
_path
(
parent
)
parent_path
=
self
.
_path
(
parent
)
if
len
(
upload_path
)
==
1
and
(
parent
!=
upload_path
[
0
]):
if
upload_path
and
len
(
upload_path
)
==
1
and
(
chunk
in
upload_path
[
0
]):
path
=
self
.
_join
(
parent_path
,
upload_path
[
0
]
.
lstrip
(
self
.
path_sep
))
path
=
self
.
_join
(
parent_path
,
upload_path
[
0
]
.
lstrip
(
self
.
path_sep
))
elif
upload_path
and
(
parent
!=
upload_path
[
0
]):
path
=
self
.
_join
(
parent_path
,
upload_path
[
0
]
.
lstrip
(
self
.
path_sep
),
chunk
)
else
:
else
:
path
=
self
.
_join
(
parent_path
,
chunk
)
path
=
self
.
_join
(
parent_path
,
chunk
)
return
{
"added"
:
[
self
.
_info
(
path
)]}
return
{
"added"
:
[
self
.
_info
(
path
)]}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment