TFileUpload displays a file upload field on a page. Upon postback, the text entered into the field will be treated as the name of the file that will be uploaded to the server. The property {@link getHasFile HasFile} indicates whether the file upload is successful. If successful, the file may be obtained by calling {@link saveAs} to save it at a specified place. You can use {@link getFileName FileName}, {@link getFileType FileType}, {@link getFileSize FileSize} to get the original client-side file name, the file mime type, and the file size information. If the upload is not successful, {@link getErrorCode ErrorCode} contains the error code describing the cause of failure. TFileUpload raises {@link onFileUpload OnFileUpload} event if a file is uploaded (whether it succeeds or not).
Since: 3.0
Inheritance: extends TWebControl, implements Prado\Web\UI\IPostBackDataHandler, implements Prado\Web\UI\IValidatable
Beispiel #1
0
 /**
  * Adds ID attribute, and renders the javascript for active component.
  * @param THtmlWriter the writer used for the rendering purpose
  */
 public function addAttributesToRender($writer)
 {
     parent::addAttributesToRender($writer);
     $writer->addAttribute('id', $this->getClientID());
     $this->getPage()->getClientScript()->registerPradoScript('activefileupload');
     $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getClientOptions());
 }