[ Index ]

PHP Cross Reference of Web Application Component Toolkit

title

Body

[close]

/framework/validation/rules/ -> fileupload.inc.php (summary)

(no description)

Version: $Id: fileupload.inc.php,v 1.3 2004/11/16 01:55:37 jeffmoore Exp $
File Size: 182 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 4 classes

fileuploadrequiredrule:: (2 methods):
  fileuploadrequiredrule()
  validate()

fileuploadpartialrule:: (2 methods):
  fileuploadpartialrule()
  check()

fileuploadmaxsizerule:: (3 methods):
  fileuploadmaxsizerule()
  check()
  _sizetohuman()

fileuploadmimetyperule:: (2 methods):
  fileuploadmimetyperule()
  check()


Class: fileuploadrequiredrule  - X-Ref

Replaces RequiredRule for FileUploads.

fileuploadrequiredrule($fieldname)   X-Ref
Constructs RequiredRule

access: public
param: string fieldname to validate

validate(&$DataSource, &$ErrorList)   X-Ref
Perform validation

access: public
param: DataSource - Data to validate
param: ErrorList
return: boolean

Class: fileuploadpartialrule  - X-Ref

Check that a partial file upload error didn't occur. Will only work with PHP
>= 4.2.0

fileuploadpartialrule($fieldname)   X-Ref
Constructs FileUploadPartialRule

access: public
param: string fieldname to validate

check($value)   X-Ref
Check that an uploaded file was fully uploaded.

access: protected
param: string value to validate
return: void

Class: fileuploadmaxsizerule  - X-Ref

Check that the size of an uploaded file was not too large.

fileuploadmaxsizerule($fieldname, $maxsize = NULL)   X-Ref
Constructs a FileUploadMaxSizeRule

access: public
param: string fieldname to validate
param: int max allowable size (in bytes) of the uploaded file

check($value)   X-Ref
Check that the uploaded file was smaller than a programmer defined size;
then (if PHP >= 4.2.0) the value (if any) set in the form MAX_FILE_SIZE
and the php.ini upload_max_filesize setting;

access: protected
param: string value to validate
return: void

_sizetohuman($filesize = 0)   X-Ref
Utility function returns readable filesizes for the error message.

access: private
param: int (optional) filesize
return: string human readable filesize

Class: fileuploadmimetyperule  - X-Ref

Check that an uploaded file has an acceptable mime type

fileuploadmimetyperule($fieldname, $mimetypes = array()   X-Ref
Constructs a FileUploadMimeTypeRule

access: public
param: string fieldname to validate
param: array of acceptable mimetypes

check($value)   X-Ref
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.

access: protected
param: string value to validate
return: void



Generated: Sun Nov 28 19:36:09 2004 Cross-referenced by PHPXref 0.5