Read from the wrapped `file`

This commit is contained in:
niten 2023-01-10 11:30:43 -08:00
parent 7ba41ca26c
commit 61c06c94b2
1 changed files with 1 additions and 1 deletions

View File

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