FileType does not care about the extension anymore.

This commit is contained in:
Jonas Winkler 2020-11-20 16:18:59 +01:00
parent 41650f20f4
commit 3d5b66c2b7
4 changed files with 118 additions and 164 deletions

View file

@ -34,8 +34,7 @@ class UploadForm(forms.Form):
os.makedirs(settings.SCRATCH_DIR, exist_ok=True)
# TODO: dont just append pdf. This is here for taht weird regex check at the start of the consumer.
with tempfile.NamedTemporaryFile(prefix="paperless-upload-", suffix=".pdf", dir=settings.SCRATCH_DIR, delete=False) as f:
with tempfile.NamedTemporaryFile(prefix="paperless-upload-", dir=settings.SCRATCH_DIR, delete=False) as f:
f.write(document)
os.utime(f.name, times=(t, t))