Log in

View Full Version : One file upload form for different file types



JasonDFR
11-02-2008, 06:46 PM
I would like to make one form which allows uploads of different file types.

I know this is possible, however I am struggling with how require x number of a certain file type.

If I have a form asking for 1 text file, 2 photos, and 1 video file, what is stopping someone from uploading 4 photos?

I need to validate, but what is the best way? I can't figure out how to validate.

In my mind this is getting very complicated.

Thanks!

Jesdisciple
11-03-2008, 08:16 PM
The program will be simple, but you must work for that simplicity. See finfo_file (http://www.php.net/manual/en/function.finfo-file.php) for the central function; see Installing/Configuring (http://www.php.net/manual/en/fileinfo.setup.php) for what you need to do to get it (and pay attention to the comments!).