Read from the wrapped `file`
This commit is contained in:
parent
7ba41ca26c
commit
61c06c94b2
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue