Re: Checking whether a file is a genuine PDF file
Re: Checking whether a file is a genuine PDF file
- Subject: Re: Checking whether a file is a genuine PDF file
- From: Kyle Sluder <email@hidden>
- Date: Mon, 5 Oct 2009 19:06:58 -0700
On Mon, Oct 5, 2009 at 6:30 PM, Graham Cox <email@hidden> wrote:
> This is true, but how far are you prepared to go? Others have suggested
> checking a few bytes into the file's header which should be reasonable
> enough, but I could create a file having a valid PDF header and garbage
> thereafter... you cannot protect yourself against that sort of thing, so the
> question is where your code would draw the line. Most people would draw it
> with a simple check of the extension and maybe for files that traditionally
> have been subject to extension abuse (I don't think pdf is one of them), a
> few header bytes.
Please don't read files that you haven't been asked to open. Those of
us with network-mounted home directories will not appreciate our open
dialogs beachball as your delegate traverses the network for every
single file.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden