To restrict files of only certain extensions, you can first validate with JavaScript & then on the server-side with PHP

For client-side, validation you can use the jQuery Validation plugin - http://docs.jquery.com/Plugins/Validation/Methods/accept#extensionortry this snippet - http://stackoverflow.com/questions/651700/how-to-have-jquery-restrict-file-types-on-upload

You can then check for the file's MIME content & extension in PHP as explained here - http://hungred.com/2009/08/17/useful-information/secure-file-upload-check-list-php/

Hello, I had the same question the original poster asked so I thought I'd ask it here. I'd like to restrict what files can be uploaded to .doc and .pdf. I tried your scripts and none of them seem to work. I've tried all kinds of restricting file scripts and I either get a syntax error or the script doesn't work and still lets me upload any type of file. I'm pretty new to php...can you tell me what I'm doing wrong? Here's what I have: