Unstructured-IO / unstructured-api

Apache License 2.0
528 stars 110 forks source link

Catch BadZipFile errors #277

Closed Coniferish closed 1 year ago

Coniferish commented 1 year ago

Summary

Closes #268

Testing

import requests

filename = "sample-docs/fake-text.txt"
resp = requests.post("http://localhost:8000/general/v0/general",
    files={"files": (filename, open(filename, "rb"), "application/vnd.openxmlformats-officedocument.wordprocessingml.document")},
    )
resp.text
Coniferish commented 1 year ago

Awesome! Can you add a test case like the PdfStream one? Just to send some sample doc with the wrong content type.

Ah, sure thing!