PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TActiveFileUpload

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 getHasFile HasFile indicates whether the file upload is successful. If successful, the file may be obtained by calling TActiveFileUpload::saveAs() to save it at a specified place. You can use getFileName FileName, getFileType FileType, 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, getErrorCode ErrorCode contains the error code describing the cause of failure.

TActiveFileUpload raises onFileUpload 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 onFileUpload 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.

TComponent
Extended by TApplicationComponent
Extended by TControl implements IRenderable, IBindable
Extended by TWebControl implements IStyleable
Extended by TFileUpload implements IPostBackDataHandler, IValidatable
Extended by TActiveFileUpload implements IActiveControl, ICallbackEventHandler, INamingContainer
Package: System\Web\UI\ActiveControls
Author: Bradley Booms <Bradley.Booms@nsighttel.com>
Author: Christophe Boulain <Christophe.Boulain@gmail.com>
Located at Web/UI/ActiveControls/TActiveFileUpload.php
Methods summary
public
# __construct( )

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.

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.

Overrides

TControl::__construct()
protected string
# getAssetUrl( string $file = '' )

Parameters

$file
string
asset file in the self::SCRIPT_PATH directory.

Returns

string
asset file url.
public
# onFileUpload( TEventParameter $param )

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.

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.

Parameters

$param
TEventParameter
event parameter to be passed to the event handlers

Overrides

TFileUpload::onFileUpload()
public string
# getTempPath( )

Returns

string
the path where the uploaded file will be stored temporarily, in namespace format default "Application.runtime.*"
public
# setTempPath( string $value )

Parameters

$value
string
the path where the uploaded file will be stored temporarily in namespace format default "Application.runtime.*"
public boolean
# getAutoPostBack( )

Returns

boolean
a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true. Note: When set to false, you will need to trigger the callback yourself.
public
# setAutoPostBack( boolean $value )

Parameters

$value
boolean
a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true. Note: When set to false, you will need to trigger the callback yourself.
public string
# getCallbackJavascript( )

Returns

string
A chuck of javascript that will need to be called if {getAutoPostBack AutoPostBack is set to false}
public
# onInit( TEventParameter $sender )

Parameters

$sender
TEventParameter
event parameter to be passed to the event handlers

Throws

TInvalidDataValueException
if the getTempPath TempPath is not writable.

Overrides

TControl::onInit()
public
# raiseCallbackEvent( TCallbackEventParameter $param )

Raises OnFileUpload event.

Raises OnFileUpload event.

This method is required by ICallbackEventHandler interface. This method is mainly used by framework and control developers.

Parameters

$param
TCallbackEventParameter
the event parameter

Implementation of

ICallbackEventHandler::raiseCallbackEvent()
public
# raisePostDataChangedEvent( )

Raises postdata changed event. This method calls TActiveFileUpload::onFileUpload() method This method is primarily used by framework developers.

Raises postdata changed event. This method calls TActiveFileUpload::onFileUpload() method This method is primarily used by framework developers.

Overrides

TFileUpload::raisePostDataChangedEvent()
protected
# pushParamsAndGetToken( TActiveFileUploadCallbackParams $params )
protected
# popParamsByToken( mixed $token )
public
# onPreRender( mixed $param )

Publish the javascript

Publish the javascript

Parameters

$param
mixed
event parameter

Overrides

TFileUpload::onPreRender()
public
# createChildControls( )

Creates child controls. This method can be overriden for controls who want to have their controls. Do not call this method directly. Instead, call TControl::ensureChildControls() to ensure child controls are created only once.

Creates child controls. This method can be overriden for controls who want to have their controls. Do not call this method directly. Instead, call TControl::ensureChildControls() to ensure child controls are created only once.

Overrides

TControl::createChildControls()
public
# onUnload( TEventParameter $param )

Removes localfile on ending of the callback.

Removes localfile on ending of the callback.

Parameters

$param
TEventParameter
event parameter to be passed to the event handlers

Overrides

TControl::onUnload()
public TBaseActiveCallbackControl
# getActiveControl( )

Returns

TBaseActiveCallbackControl
standard callback control options.

Implementation of

IActiveControl::getActiveControl()
public TCallbackClientSide
# getClientSide( )

Returns

TCallbackClientSide
client side request options.
public
# addAttributesToRender( THtmlWriter $writer )

Adds ID attribute, and renders the javascript for active component.

Adds ID attribute, and renders the javascript for active component.

Parameters

$writer
THtmlWriter
the writer used for the rendering purpose

Overrides

TFileUpload::addAttributesToRender()
protected string
# getClientClassName( )

Returns

string
corresponding javascript class name for this control.
protected array
# getClientOptions( )

Gets the client side options for this control.

Gets the client side options for this control.

Returns

array
( inputID => input client ID, flagID => flag client ID, targetName => target unique ID, formID => form client ID, indicatorID => upload indicator client ID, completeID => complete client ID, errorID => error client ID)
public boolean
# saveAs( string $fileName, boolean $deleteTempFile = true )

Saves the uploaded file.

Saves the uploaded file.

Parameters

$fileName
string
the file name used to save the uploaded file
$deleteTempFile
boolean
whether to delete the temporary file after saving. If true, you will not be able to save the uploaded file again.

Returns

boolean
true if the file saving is successful

Overrides

TFileUpload::saveAs()
public TImage
# getSuccessImage( )

Returns

TImage
the image displayed when an upload completes successfully.
public TImage
# getErrorImage( )

Returns

TImage
the image displayed when an upload does not complete successfully.
public TImage
# getBusyImage( )

Returns

TImage
the image displayed when an upload is in progress.
Methods inherited from TFileUpload
getDataChanged(), getErrorCode(), getFileName(), getFileSize(), getFileType(), getHasFile(), getIsValid(), getLocalName(), getMaxFileSize(), getTagName(), getValidationPropertyValue(), loadPostData(), setIsValid(), setMaxFileSize()
Methods inherited from TWebControl
clearStyle(), copyBaseAttributes(), createStyle(), getAccessKey(), getBackColor(), getBorderColor(), getBorderStyle(), getBorderWidth(), getCssClass(), getDecorator(), getDisplay(), getEnsureId(), getFont(), getForeColor(), getHasStyle(), getHeight(), getStyle(), getTabIndex(), getToolTip(), getWidth(), render(), renderBeginTag(), renderContents(), renderEndTag(), setAccessKey(), setBackColor(), setBorderColor(), setBorderStyle(), setBorderWidth(), setCssClass(), setDisplay(), setEnsureId(), setForeColor(), setHeight(), setStyle(), setTabIndex(), setToolTip(), setWidth()
Methods inherited from TControl
__get(), addParsedObject(), addToPostDataLoader(), addedControl(), applyStyleSheetSkin(), autoBindProperty(), autoDataBindProperties(), bindProperty(), broadcastEvent(), bubbleEvent(), clearChildState(), clearControlState(), clearNamingContainer(), clearViewState(), convertUniqueIdToClientId(), createControlCollection(), dataBind(), dataBindChildren(), dataBindProperties(), ensureChildControls(), findControl(), findControlsByID(), findControlsByType(), focus(), getAdapter(), getAllowChildControls(), getAttribute(), getAttributes(), getChildControlsCreated(), getClientID(), getControlStage(), getControlState(), getControls(), getCustomData(), getEnableTheming(), getEnableViewState(), getEnabled(), getHasAdapter(), getHasAttributes(), getHasChildInitialized(), getHasControls(), getHasInitialized(), getHasLoaded(), getHasLoadedPostData(), getHasPreRendered(), getID(), getIsSkinApplied(), getNamingContainer(), getPage(), getParent(), getRegisteredObject(), getSkinID(), getSourceTemplateControl(), getTemplateControl(), getUniqueID(), getViewState(), getVisible(), hasAttribute(), initRecursive(), isDescendentOf(), isObjectRegistered(), loadRecursive(), loadState(), loadStateRecursive(), onDataBinding(), onLoad(), preRenderRecursive(), raiseBubbleEvent(), registerObject(), removeAttribute(), removedControl(), renderChildren(), renderControl(), saveState(), saveStateRecursive(), setAdapter(), setAttribute(), setChildControlsCreated(), setControlStage(), setControlState(), setCustomData(), setEnableTheming(), setEnableViewState(), setEnabled(), setID(), setPage(), setSkinID(), setTemplateControl(), setViewState(), setVisible(), trackViewState(), traverseChildControls(), unbindProperty(), unloadRecursive(), unregisterObject()
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __destruct(), __isset(), __set(), __sleep(), __unset(), __wakeup(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants summary
string SCRIPT_PATH 'prado/activefileupload'
#
Constants inherited from TFileUpload
MAX_FILE_SIZE
Constants inherited from TControl
AUTOMATIC_ID_PREFIX, CLIENT_ID_SEPARATOR, CS_CHILD_INITIALIZED, CS_CONSTRUCTED, CS_INITIALIZED, CS_LOADED, CS_PRERENDERED, CS_STATE_LOADED, ID_FORMAT, ID_SEPARATOR, IS_CHILD_CREATED, IS_CREATING_CHILD, IS_DISABLE_THEMING, IS_DISABLE_VIEWSTATE, IS_ID_SET, IS_SKIN_APPLIED, IS_STYLESHEET_APPLIED, RF_ADAPTER, RF_AUTO_BINDINGS, RF_CHILD_STATE, RF_CONTROLS, RF_CONTROLSTATE, RF_DATA_BINDINGS, RF_EVENTS, RF_NAMED_CONTROLS, RF_NAMED_CONTROLS_ID, RF_NAMED_OBJECTS, RF_SKIN_ID
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Properties inherited from TFileUpload
$_errorCode
Properties inherited from TWebControl
$_decorator
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO