Clonefish comes with a powerful file input validation. You can
set a file input to be mandatory (which is checked on the client side with
JavaScript too!). Furthermore, you can check not only the
filetypes (and channels (RGB/CMYK) for JPGs), but also the
required minimum/maximum filesize. The maximum size is set to
the upload_max_filesize PHP setting by default -
quite comfortable!
The form also demonstrates the use of the 'binaryvalue' setting:
that's why the methods of clonefish will return the (binary)
contents of the file (in the test page you'll only see a note
instead of the contents, since
binary contents don't look nice in browsers - check the "Results of a
$clonefish->getElementValues() call" section below after
submission)
Below are the dumps of some PHP variables - submit the form to see the changes!
Contents of the $_POST array:
$_POST = array (
)
Results of a $clonefish->getElementValues() call: array ( 'inputfile1' => NULL, 'id' => 'validfile', )