Update app.py
Browse files
app.py
CHANGED
|
@@ -169,11 +169,11 @@ class encodedImage(BaseModel):
|
|
| 169 |
|
| 170 |
|
| 171 |
@app.post('/')
|
| 172 |
-
async def _file_upload(
|
| 173 |
UploadFile = File(...)):
|
| 174 |
|
| 175 |
-
|
| 176 |
-
contents = await
|
| 177 |
|
| 178 |
mrzscanner.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==")
|
| 179 |
scanner = mrzscanner.createInstance()
|
|
@@ -193,7 +193,7 @@ async def _file_upload(my_file:
|
|
| 193 |
json_file=""
|
| 194 |
|
| 195 |
else:
|
| 196 |
-
success=
|
| 197 |
errorMessage="None"
|
| 198 |
|
| 199 |
|
|
|
|
| 169 |
|
| 170 |
|
| 171 |
@app.post('/')
|
| 172 |
+
async def _file_upload(img:
|
| 173 |
UploadFile = File(...)):
|
| 174 |
|
| 175 |
+
img.filename = f"{uuid.uuid4()}.jpg"
|
| 176 |
+
contents = await img.read() # <-- Important!
|
| 177 |
|
| 178 |
mrzscanner.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==")
|
| 179 |
scanner = mrzscanner.createInstance()
|
|
|
|
| 193 |
json_file=""
|
| 194 |
|
| 195 |
else:
|
| 196 |
+
success=True
|
| 197 |
errorMessage="None"
|
| 198 |
|
| 199 |
|