Need to create file, too

This commit is contained in:
niten 2023-01-09 11:03:01 -08:00
parent 1e3012bf7f
commit e71fdd6977
1 changed files with 1 additions and 1 deletions

View File

@ -117,7 +117,7 @@ def analyze_image(request: Request, image: UploadFile):
infile = open(incoming_dir / image.filename) infile = open(incoming_dir / image.filename)
file_hash = hashlib.sha256() file_hash = hashlib.sha256()
file_hash.update(image) file_hash.update(image)
with open(infile, "wb") as f: with open(infile, "wxb") as f:
chunk = image.read(buffer_size) chunk = image.read(buffer_size)
while chunk: while chunk:
print ("writing " + buffer_size + " bytes") print ("writing " + buffer_size + " bytes")