Fix download a file wasnt exists

This commit is contained in:
Jerry Yan 2019-04-08 23:05:06 +08:00 committed by JerryYan
parent ef7d4c8d3e
commit 86fbf31120

View File

@ -161,7 +161,10 @@ def fileDownload(path):
with open(file, "rb") as f:
for row in f:
yield row
return Response(generate(path), mimetype='application/octet-stream')
if os.path.exists(path):
return Response(generate(path), mimetype='application/octet-stream')
else:
return Response(status=404)
def SubThread():