Here is what I have currently to validate the file type on upload to a
if ($htm1 != "" && eregi('.htm$', $htm1)) {
@copy("$htm1", "/path/to/upload/directory/$htm1") or die ("Could not upload
file, please try again after making sure the file is less than 2mb in size
and the file name correct");
 } else {
   die("No file selected for upload, or the file was not the correct type.
Please only upload .htm files.");
Right now it just checkes the file extension, I would like to know how I can
use this piece of code and add the functionality of actually checking the
file first.  If anyone can point me in the right direction that would be
Thanks in advance,

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to