PHP 클래스 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 {@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. TActiveFileUpload raises {@link 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 {@link 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. TActiveFileUpload needs either an application level cache or a security manager to work securely.
저자: Bradley Booms ([email protected])
저자: Christophe Boulain ([email protected])
상속: extends Prado\Web\UI\WebControls\TFileUpload, implements Prado\Web\UI\ActiveControls\IActiveControl, implements Prado\Web\UI\ActiveControls\ICallbackEventHandler, implements Prado\Web\UI\INamingContainer
파일 보기 프로젝트 열기: pradosoft/prado

공개 메소드들

메소드 설명
__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.
addAttributesToRender ( $writer ) Adds ID attribute, and renders the javascript for active component.
createChildControls ( )
getActiveControl ( ) : TBaseActiveCallbackControl
getAutoPostBack ( ) : boolean
getBusyImage ( ) : TImage
getCallbackJavascript ( ) : string
getClientSide ( ) : TCallbackClientSide
getErrorImage ( ) : TImage
getSuccessImage ( ) : TImage
getTempPath ( ) : string
onFileUpload ( $param ) This method is invoked when a file is uploaded.
onInit ( $sender )
onPreRender ( $param ) Publish the javascript
onUnload ( $param ) Removes localfile on ending of the callback.
raiseCallbackEvent ( $param ) Raises OnFileUpload event.
raisePostDataChangedEvent ( ) Raises postdata changed event.
saveAs ( $fileName, $deleteTempFile = true ) : boolean Saves the uploaded file.
setAutoPostBack ( $value )
setTempPath ( $value )

보호된 메소드들

메소드 설명
getAssetUrl ( $file = '' ) : string
getClientClassName ( ) : string
getClientOptions ( ) : array Gets the client side options for this control.
popParamsByToken ( $token )
pushParamsAndGetToken ( TActiveFileUploadCallbackParams $params )

메소드 상세

__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.
public __construct ( )

addAttributesToRender() 공개 메소드

Adds ID attribute, and renders the javascript for active component.
public addAttributesToRender ( $writer )

createChildControls() 공개 메소드

public createChildControls ( )

getActiveControl() 공개 메소드

public getActiveControl ( ) : TBaseActiveCallbackControl
리턴 TBaseActiveCallbackControl standard callback control options.

getAssetUrl() 보호된 메소드

protected getAssetUrl ( $file = '' ) : string
리턴 string asset file url.

getAutoPostBack() 공개 메소드

public getAutoPostBack ( ) : boolean
리턴 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.

getBusyImage() 공개 메소드

public getBusyImage ( ) : TImage
리턴 Prado\Web\UI\WebControls\TImage the image displayed when an upload is in progress.

getCallbackJavascript() 공개 메소드

public getCallbackJavascript ( ) : string
리턴 string A chuck of javascript that will need to be called if {{@link getAutoPostBack AutoPostBack} is set to false}

getClientClassName() 보호된 메소드

protected getClientClassName ( ) : string
리턴 string corresponding javascript class name for this control.

getClientOptions() 보호된 메소드

Gets the client side options for this control.
protected getClientOptions ( ) : array
리턴 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)

getClientSide() 공개 메소드

public getClientSide ( ) : TCallbackClientSide
리턴 TCallbackClientSide client side request options.

getErrorImage() 공개 메소드

public getErrorImage ( ) : TImage
리턴 Prado\Web\UI\WebControls\TImage the image displayed when an upload does not complete successfully.

getSuccessImage() 공개 메소드

public getSuccessImage ( ) : TImage
리턴 Prado\Web\UI\WebControls\TImage the image displayed when an upload completes successfully.

getTempPath() 공개 메소드

public getTempPath ( ) : string
리턴 string the path where the uploaded file will be stored temporarily, in namespace format default "Application.runtime.*"

onFileUpload() 공개 메소드

If you override this method, be sure to call the parent implementation to ensure the invocation of the attached event handlers.
public onFileUpload ( $param )

onInit() 공개 메소드

public onInit ( $sender )

onPreRender() 공개 메소드

Publish the javascript
public onPreRender ( $param )

onUnload() 공개 메소드

Removes localfile on ending of the callback.
public onUnload ( $param )

popParamsByToken() 보호된 메소드

protected popParamsByToken ( $token )

pushParamsAndGetToken() 보호된 메소드

protected pushParamsAndGetToken ( TActiveFileUploadCallbackParams $params )
$params TActiveFileUploadCallbackParams

raiseCallbackEvent() 공개 메소드

This method is required by {@link ICallbackEventHandler} interface. This method is mainly used by framework and control developers.
public raiseCallbackEvent ( $param )

raisePostDataChangedEvent() 공개 메소드

This method calls {@link onFileUpload} method This method is primarily used by framework developers.

saveAs() 공개 메소드

Saves the uploaded file.
public saveAs ( $fileName, $deleteTempFile = true ) : boolean
리턴 boolean true if the file saving is successful

setAutoPostBack() 공개 메소드

public setAutoPostBack ( $value )

setTempPath() 공개 메소드

public setTempPath ( $value )