Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-tools
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ed268c24
authored
Dec 19, 2022
by
aagusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan upload
1 parent
f4684762
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
opensipkd/tools/__init__.py
opensipkd/tools/__init__.py
View file @
ed268c2
...
...
@@ -399,7 +399,7 @@ class SaveFile(object):
# number.
def
create_fullpath
(
self
,
ext
=
''
):
while
True
:
filename
=
get_random_string
()
+
ext
filename
=
get_random_string
(
32
)
+
ext
full_path
=
os
.
path
.
join
(
self
.
dir_path
,
filename
)
if
not
os
.
path
.
exists
(
full_path
):
return
full_path
...
...
@@ -478,14 +478,15 @@ class Upload(SaveFile):
return
filename
def
save_fp
(
self
,
upload
):
if
'fp'
not
in
upload
or
upload
[
'fp'
]
==
b
''
:
if
'fp'
not
in
upload
or
upload
[
'fp'
]
==
b
''
or
not
upload
[
'fp'
]
or
not
upload
[
'size'
]
:
if
"filename"
in
upload
:
return
upload
[
'filename'
]
return
filename
=
upload
[
'filename'
]
input_file
=
upload
[
'fp'
]
ext
=
get_ext
(
filename
)
return
self
.
save_to_file
(
input_file
,
ext
)
filename
=
self
.
save_to_file
(
input_file
,
ext
)
return
os
.
path
.
split
(
filename
)[
1
]
def
saves
(
self
,
uploads
):
d
=
{}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment