mirror of
https://github.com/Kakune55/ComiPy.git
synced 2025-09-16 04:09:41 +08:00
完成上传页
This commit is contained in:
11
main.py
11
main.py
@@ -82,6 +82,17 @@ def view(bookid): # 接口
|
||||
return bookid
|
||||
|
||||
|
||||
@app.route('/upload', methods=["GET", "POST"]) #文件上传
|
||||
def upload_file():
|
||||
if request.method == "GET":
|
||||
return render_template("upload.html")
|
||||
uploaded_file = request.files['file']
|
||||
if uploaded_file.filename != '':
|
||||
uploaded_file.save( config.get("file", "inputdir") + "/" + uploaded_file.filename)
|
||||
file.auotLoadFile()
|
||||
return redirect("/")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
appinit()
|
||||
app.run(
|
||||
|
Reference in New Issue
Block a user