start updating docs, other changes to file upload
All checks were successful
Release / build (push) Successful in 34s
Release / publish_head (push) Successful in 33s
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 15s
Datadog Secrets Scanning / Datadog Static Analyzer (push) Successful in 10s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 20s
Release / publish_head (release) Has been skipped
Release / build (release) Successful in 37s

This commit is contained in:
2025-03-16 21:22:28 -04:00
parent 744693a5f1
commit 2adde253c9
23 changed files with 419 additions and 247 deletions

View File

@ -149,10 +149,10 @@ def create_filemanager_blueprint(base_dir, url_prefix='/files', auth_password=No
</ul>
<button onclick="bulkCut()">Bulk Cut Selected</button>
<hr>
<h2>Upload File</h2>
<h2>Upload File(s)</h2>
<form action="{{ url_for('filemanager.upload') }}" method="post" enctype="multipart/form-data">
<input type="hidden" name="path" value="{{ rel_path }}">
<input type="file" name="file">
<input type="file" name="file" multiple>
<input type="submit" value="Upload">
</form>
<hr>
@ -276,11 +276,13 @@ def create_filemanager_blueprint(base_dir, url_prefix='/files', auth_password=No
return "Invalid path", 400
if not os.path.isdir(abs_path):
return "Not a directory", 400
file = request.files.get('file')
if file:
filename = secure_filename(file.filename)
file.save(os.path.join(abs_path, filename))
flash("Uploaded successfully")
files = request.files.getlist('file')
if files:
for file in files:
if file and file.filename:
filename = secure_filename(file.filename)
file.save(os.path.join(abs_path, filename))
flash("Uploaded files successfully")
return redirect(url_for('filemanager.index', path=rel_path))
@filemanager.route('/rename', methods=['POST'])