WACT_VALIDATION
[ class tree: WACT_VALIDATION ] [ index: WACT_VALIDATION ] [ all elements ]

Class: FileUploadMimeTypeRule

Source Location: /framework/validation/rules/fileupload.inc.php

http://wact.sourceforge.net/index.php/FileUploadMimeTypeRule

Class Overview

Rule
   |
   --SingleFieldRule
      |
      --FileUploadMimeTypeRule

Check that an uploaded file has an acceptable mime type

Variables

Methods


Inherited Variables

Inherited Methods

Class: SingleFieldRule

SingleFieldRule::SingleFieldRule()
Constructs Rule
SingleFieldRule::Check()
Check a Single Value to see if its valid
SingleFieldRule::Error()
Signal that an error has occurred.
SingleFieldRule::getField()
Returns the fieldname the rule applies to
SingleFieldRule::IsValid()
Have we already determined this error to be invalid?
SingleFieldRule::validate()
Perform validation

Class: Rule

Rule::setGroup()
Sets the error message group (related to the vars file)
Rule::validate()
Perform validation

Class Details

Check that an uploaded file has an acceptable mime type

Class Variables


$mimetypes = array()

Type:   mixed

Class Methods


constructor FileUploadMimeTypeRule

Constructs a FileUploadMimeTypeRule

FileUploadMimeTypeRule FileUploadMimeTypeRule( string $fieldname, [array $mimetypes = array()])

API Tags:

access:  public

Parameters:

string   $fieldname   fieldname to validate
array   $mimetypes   of acceptable mimetypes

method Check

Check that the mimetype of the uploaded file appears in the mimetypes array.

Some browsers won't provide a mimetype, so we can only check when it is provided.



void Check( string $value)

API Tags:

access:  protected
Overrides SingleFieldRule::Check() (Check a Single Value to see if its valid)

Parameters:

string   $value   value to validate
WACT: Copyright 2003 Procata, Inc. Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html)
Documentation generated on Sun, 28 Nov 2004 19:46:35 -0800 by phpDocumentor 1.2.3