Keep original filename on upload, remove timestamp prefix
This commit is contained in:
1 parent
79656cd661
commit
14ebfb7779
1 file changed
+1
-3
@@ -136,9 +136,7 @@ def api_upload():
|
|||||||
return jsonify({"success": False, "error": "Only .mp4 files allowed"}), 400
|
return jsonify({"success": False, "error": "Only .mp4 files allowed"}), 400
|
||||||
|
|
||||||
Path(UPLOAD_DIR).mkdir(parents=True, exist_ok=True)
|
Path(UPLOAD_DIR).mkdir(parents=True, exist_ok=True)
|
||||||
safe = secure_filename(f.filename)
|
dest_name = secure_filename(f.filename)
|
||||||
ts = datetime.now().strftime("%Y%m%d_%H%M%S_%f")
|
|
||||||
dest_name = f"{ts}_{safe}"
|
|
||||||
dest_path = Path(UPLOAD_DIR) / dest_name
|
dest_path = Path(UPLOAD_DIR) / dest_name
|
||||||
|
|
||||||
f.save(str(dest_path))
|
f.save(str(dest_path))
|
||||||
|
|||||||
Reference in new issue
Block a user