Class FileUpload (namespace Nette\Forms)


Text box and browse button that allow users to select a file to upload to the server.

Object
   |
   --Component
      |
      --FormControl
         |
         --FileUpload
Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Forms/Controls/FileUpload.php (line 34)
Public Method Summary
FileUpload
__construct (string $label)
void
setValue (array|Nette\Web\HttpUploadedFile $value)
Sets control's value.
static bool
validateFileSize (FileUpload $control, int $limit)
FileSize validator: is file size in limit?
static bool
Filled validator: has been any file uploaded?
static bool
validateMimeType (FileUpload $control, array|string $mimeType)
MimeType validator: has file specified mime type?
Protected Method Summary
protected void
attached (IComponent $form)
This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.
Methods Inherited From FormControl
__construct(), addCondition(), addConditionOn(), addError(), addRule(), cleanErrors(), getControl(), getControlPrototype(), getErrors(), getForm(), getHtmlId(), getHtmlName(), getLabel(), getLabelPrototype(), getOption(), getOptions(), getRules(), getTranslator(), getValue(), hasErrors(), isDisabled(), isRendered(), isRequired(), loadHttpData(), notifyRule(), setDisabled(), setHtmlId(), setOption(), setParent(), setRendered(), setRequired(), setTranslator(), setValue(), translate(), validateEqual(), validateFilled(), validateValid()
Methods Inherited From Component
__construct(), attached(), detached(), getName(), getParent(), getService(), getServiceLocator(), lookup(), lookupPath(), monitor(), setParent(), setServiceLocator(), validateParent(), __clone(), __wakeup()
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Variable Summary

Method Details

line 40

__construct

public FileUpload __construct (string $label)

Input
string $label label
Output
FileUpload  

line 55

attached

protected void attached (IComponent $form)

This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.

Input
IComponent $form
Output
void  

line 69

setValue

public void setValue (array|Nette\Web\HttpUploadedFile $value)

Sets control's value.

Input
array|Nette\Web\HttpUploadedFile $value
Output
void  

line 104

validateFileSize

public static bool validateFileSize (FileUpload $control, int $limit)

FileSize validator: is file size in limit?

Input
FileUpload $control
int $limit file size limit
Output
bool  

line 90

validateFilled

public static bool validateFilled (IFormControl $control)

Filled validator: has been any file uploaded?

Input
IFormControl $control
Output
bool  

line 118

validateMimeType

public static bool validateMimeType (FileUpload $control, array|string $mimeType)

MimeType validator: has file specified mime type?

Input
FileUpload $control
array|string $mimeType mime type
Output
bool