Class \Prado\Web\UI\ActiveControls\TActiveFileUpload
TActiveFileUpload 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 \Prado\Web\UI\ActiveControls\getHasFile indicates whether the file upload is successful. If successful, the file may be obtained by calling saveAs to save it at a specified place. You can use \Prado\Web\UI\ActiveControls\getFileName, \Prado\Web\UI\ActiveControls\getFileType, \Prado\Web\UI\ActiveControls\getFileSize to get the original client-side file name, the file mime type, and the file size information. If the upload is not successful, \Prado\Web\UI\ActiveControls\getErrorCode contains the error code describing the cause of failure.
TActiveFileUpload raises \Prado\Web\UI\ActiveControls\onFileUpload event if a file is uploaded (whether it succeeds or not).
TActiveFileUpload actually does a postback in a hidden IFrame, and then does a callback. This callback then raises the \Prado\Web\UI\ActiveControls\onFileUpload event. After the postback a status icon is displayed; either a green checkmark if the upload is successful, or a red x if there was an error.
TActiveFileUpload needs either an application level cache or a security manager to work securely.
Since Prado 4.0 the TActiveFileUpload supports HTML5 multiple file uploads by setting the \Prado\Web\UI\ActiveControls\setMultiple attribute to true. See the description of the parent class TFileUpload for further details.
Class hierarchy
- \Prado\Web\UI\ActiveControls\TActiveFileUpload implements IActiveControl, ICallbackEventHandler, INamingContainer
- \Prado\Web\UI\WebControls\TFileUpload implements IPostBackDataHandler, IValidatable
- \Prado\Web\UI\WebControls\TWebControl implements IStyleable
- \Prado\Web\UI\TControl implements IRenderable, IBindable
- \Prado\TApplicationComponent
- \Prado\TComponent
Author: Christophe Boulain <Christophe.Boulain@gmail.com>
Author: LANDWEHR Computer und Software GmbH <programmierung@landwehr-software.de>
public
|
__construct() : mixed
Creates a new callback control, sets the adapter to
TActiveControlAdapter. If you override this class, be sure to set the
adapter appropriately by, for example, by calling this constructor.
|
public
|
addAttributesToRender(THtmlWriter $writer) : mixed
Adds ID attribute, and renders the javascript for active component.
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
onFileUpload(TEventParameter $param) : mixed
This method is invoked when a file is uploaded.
If you override this method, be sure to call the parent implementation to ensure the invocation of the attached event handlers. |
public
|
|
public
|
|
public
|
|
public
|
raiseCallbackEvent(TCallbackEventParameter $param) : mixed
Raises <b>OnFileUpload</b> event.
This method is required by ICallbackEventHandler interface. This method is mainly used by framework and control developers. |
public
|
raisePostDataChangedEvent() : mixed
Raises postdata changed event.
This method calls onFileUpload method This method is primarily used by framework developers. |
public
|
|
public
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
public
mixed
|
SCRIPT_PATH
|
'activefileupload'
|