Small cleanup changes
This commit is contained in:
parent
1e80ab2c0c
commit
983d3b5a11
10
interface.py
10
interface.py
@ -121,13 +121,13 @@ def upload():
|
||||
targetdir = request.form['targetdir'].strip()
|
||||
if targetdir == '':
|
||||
targetdir = 'uploads/'
|
||||
elif '..' in targetdir:
|
||||
elif '../' in targetdir:
|
||||
return redirect("./", code=406)
|
||||
|
||||
print('Uploading file:')
|
||||
print('filename:', filename)
|
||||
print('targetdir:', targetdir)
|
||||
print('mimetype:', file.mimetype)
|
||||
#print('Uploading file:')
|
||||
#print('filename:', filename)
|
||||
#print('targetdir:', targetdir)
|
||||
#print('mimetype:', file.mimetype)
|
||||
|
||||
if "audio" in file.mimetype:
|
||||
storagepath = os.path.abspath(os.path.join(var.music_folder, targetdir))
|
||||
|
@ -61,8 +61,9 @@
|
||||
<form action="./upload" method="post" enctype="multipart/form-data">
|
||||
<input type="file" name="file" value="Browse Music file"/>
|
||||
Upload into
|
||||
<input list="targetdirs" id="targetdir" name="targetdir" />
|
||||
<input list="targetdirs" id="targetdir" name="targetdir" placeholder="uploads" />
|
||||
<datalist id="targetdirs">
|
||||
<option value="uploads">
|
||||
{% for dir in music_library.get_subdirs_recursively() %}
|
||||
<option value="{{ dir }}">
|
||||
{% endfor %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user