Рассмотрим этот код
file = request.files["wg_puid"]
filename = hash + ".wargamerpl2"
zipname = hash + ".zip"
file.save(os.path.join(UPLOAD_FOLDER, filename))
os.chdir(UPLOAD_FOLDER)
zipfile.ZipFile(zipname, mode='w').write(os.path.join(UPLOAD_FOLDER, filename))
if os.path.exists(filename):
os.remove(filename)
else:
return apology("Something went wrong", 400)
# Uploads replay to S3
# TODO fix error
key = boto.s3.key.Key(bucket, zipname)
with open(zipname, "rb") as f:
key.send_file(f)
Что я пытаюсь .zip файл, который загружен на сервер, а затем отправить этот файл в мое ведро S3.В настоящее время я получаю сообщение об ошибке:
boto.exception.S3ResponseError: S3ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?><Error><Code>BadRequest</Code><Message>An error occurred when parsing the HTTP request.</Message><RequestId>3184ACA27BE403B1</RequestId><HostId>...</HostId></Error>
Что здесь с моим кодом?