upload splitting didnt work for unsafe names
This commit is contained in:
12
code/app.py
12
code/app.py
@@ -14,7 +14,7 @@ from utils.utils import *
|
|||||||
from utils.crypt import *
|
from utils.crypt import *
|
||||||
|
|
||||||
|
|
||||||
__FLEES_VERSION__ = "20180701.0"
|
__FLEES_VERSION__ = "20180702.0"
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config.from_object(__name__)
|
app.config.from_object(__name__)
|
||||||
# Read config from json !
|
# Read config from json !
|
||||||
@@ -114,6 +114,7 @@ def upload(name = None, token = None):
|
|||||||
if os.path.exists(filename):
|
if os.path.exists(filename):
|
||||||
file_versionize(filename)
|
file_versionize(filename)
|
||||||
#~ return "Overwrite forbidden", 403
|
#~ return "Overwrite forbidden", 403
|
||||||
|
print_debug("Saving " + filename)
|
||||||
file.save(filename)
|
file.save(filename)
|
||||||
set_rights(filename)
|
set_rights(filename)
|
||||||
notify({
|
notify({
|
||||||
@@ -154,11 +155,14 @@ def upload_join_splitted(name, token):
|
|||||||
for part in range(no_parts):
|
for part in range(no_parts):
|
||||||
filename = os.path.join(
|
filename = os.path.join(
|
||||||
share['path'],
|
share['path'],
|
||||||
".%s.part.%03d"%(
|
secure_filename_hidden(
|
||||||
request.form['filename'],
|
".%s.part.%03d"%(
|
||||||
part
|
request.form['filename'],
|
||||||
|
part
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
print_debug("Checking for join: " + filename)
|
||||||
if os.path.exists(filename):
|
if os.path.exists(filename):
|
||||||
parts.append(filename)
|
parts.append(filename)
|
||||||
part_existed = part
|
part_existed = part
|
||||||
|
|||||||
Reference in New Issue
Block a user