Open file in binary mode
This commit is contained in:
parent
0915ec019b
commit
c903c73270
|
@ -116,7 +116,7 @@ def analyze_image(request: Request, image: UploadFile):
|
|||
base_url = re.sub(r'\/images\/?$', '/analyzed_images/', str(request.url))
|
||||
infile = incoming_dir / image.filename
|
||||
file_hash = hashlib.sha256()
|
||||
with open(infile, "w") as f:
|
||||
with open(infile, "wb") as f:
|
||||
chunk = image.file.read(buffer_size)
|
||||
while chunk:
|
||||
file_hash.update(chunk)
|
||||
|
|
Loading…
Reference in New Issue