data-skeptic / serverless-upload-accepter

A Chalice based Serverless microservice which accepts PDF files as uploads and saves them to S3.
0 stars 0 forks source link

Server-side verification of PDF files #3

Open kylepolich opened 4 years ago

kylepolich commented 4 years ago

Spend 2-3 hours researching and implementing the best way to test if the file is a PDF.

Certainly there is time enough to check that the file ends in .pdf at a minimum.

Does a nice python library (which does not increase the deployment.zip file by too much) exist which can check the header of the file?

Any way to do something like this?

try:
    test = pdf_loader.load(filename)
    print("this is a pdf")
except:
    print("not a pdf")

Find the best solution without extreme effort.

webmaster0820 commented 4 years ago

I think that Server-side verification of PNF files should be Server-side verification of PDF files, right?