Does anyone have a recommended way to validate PDF files which are
being uploaded?

I only plan on uploading PDFs through the admin but wanted to know a
more robust way than simply checking the extension.

   file_reference = models.FileField(upload_to='xxdirnamexx',
blank=True,    validator_list =
[filenameEndsWith(choices=FILETYPES_FOR_UPLOAD),])

I have ReportLab installed but have only used it for creating PDFs--not
opening existing ones.

Would it be worth checking the file itself?  For example, checking for
"%PDF-1" as the first characters?

Thanks for your help,

raman


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to