I have a form wher users can upload files. How do I restrict them to particular file types?
Also, I'd like to to check for file size and set file size restriction.
You can retrieve this type of information using ImageMagick. Once you have the information you need, you can create handlers with PHP.
Imagemagick works great for images. Otherwise you can use the filesize() function to determine a size and handle it appropriately.
or something like this
$type = substr($filename, -3); if ($type == 'txt') { //ok } else { //bad filetype }
Remember file extensions can mean nothing in Linux. You want to read the mime-type of the file. I do not know how to do that (without looking it up).