Re: Question: Limiting Filetypes Uploaded

2005-03-03 Thread Dan Wilga
At 6:08 PM -0500 3/2/05, Jonathan Vanasco wrote: Great points, and I figured as much would be needed to 'rule in' acceptable items do you think that the browser mime type would be sufficient to 'rule out' items as a preliminary check? Not really. You're pretty likely to get a bogus type (like a

Re: Question: Limiting Filetypes Uploaded

2005-03-03 Thread Jonathan Vanasco
On Mar 3, 2005, at 11:29 AM, Richard F. Rebel wrote: The module I wrote is owned by my prior employer, sorry. I don't know of any other module either. It wasn't that hard to write tho. The part about timing of connections is relatively simple as well, if you don't get X bytes over X amount of tim

Re: Question: Limiting Filetypes Uploaded

2005-03-03 Thread Richard F. Rebel
On Wed, 2005-03-02 at 23:48 -0500, jonathan vanasco wrote: > On Mar 2, 2005, at 7:21 PM, Richard F. Rebel wrote: > > I worked for a company who did mass free hosting and I can tell you > > that > > browser supplied mime types are not enough in many situations. > I agree - my question was if they t

Re: Question: Limiting Filetypes Uploaded

2005-03-02 Thread jonathan vanasco
On Mar 2, 2005, at 7:21 PM, Richard F. Rebel wrote: I worked for a company who did mass free hosting and I can tell you that browser supplied mime types are not enough in many situations. I agree - my question was if they tended to call a 'valid' file invalid, or an invalid file valid -- the idea

Re: Question: Limiting Filetypes Uploaded

2005-03-02 Thread Richard F. Rebel
I worked for a company who did mass free hosting and I can tell you that browser supplied mime types are not enough in many situations. I had to resort to file magic byte testing (technique used by the unix 'file' command), and then further to ensuring that tar's, rar's, bzip's, pkzip's etc all p

Re: Question: Limiting Filetypes Uploaded

2005-03-02 Thread Jonathan Vanasco
Great points, and I figured as much would be needed to 'rule in' acceptable items do you think that the browser mime type would be sufficient to 'rule out' items as a preliminary check? ie: if it passes the mime test, do a size test, else don't bother or, would that probably toss too many good

Re: Question: Limiting Filetypes Uploaded

2005-03-02 Thread Dan Wilga
At 1:44 PM -0500 3/1/05, Jonathan Vanasco wrote: I'm in need of a 'good' method to limit files uploaded via mod_perl2 ( to photos of gif/jpg/png 100k or less) 2 - i've noticed a type of "image/jpeg" "image/gif" "image/png" for uploaded file types. can this be relied on to any extent? I would

Question: Limiting Filetypes Uploaded

2005-03-01 Thread Jonathan Vanasco
I'm in need of a 'good' method to limit files uploaded via mod_perl2 ( to photos of gif/jpg/png 100k or less) How have others approached this? I haven't found much on the subject (and it took me FOREVER to figure out that i needed to use Apache::Upload() for mp2!) With the test code below, i