Detailed Description
Class processes file uploads.
- Author
- Dodonov A.A.
Definition at line 28 of file file_input_controller.php.
Constructor & Destructor Documentation
Constructor.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 69 of file file_input_controller.php.
{
try
{
$this->FileInputAlgorithms =
get_package(
'file_input::file_input_algorithms' ,
'last' , __FILE__ );
$this->Security =
get_package(
'security' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
Component's controller.
- Parameters
-
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 290 of file file_input_controller.php.
{
try
{
$UploadFile = $Options->get_setting( 'upload_file' , false );
$NotDirectControllerCall = $this->Security->get_s( 'direct_controller' , 'integer' , 0 ) == 0;
if( $UploadFile && $NotDirectControllerCall && count( $_FILES ) )
{
}
}
catch( Exception $e )
{
}
}
| display_file_info |
( |
|
$SavePath, |
|
|
|
$FileId, |
|
|
|
$OriginalFileName |
|
) |
| |
Function displays data for client.
- Parameters
-
| $SavePath | - Destination path. |
| $FileId | - id of the uploaded file. |
| $OriginalFileName | - Name of the uploaded file. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 162 of file file_input_controller.php.
{
try
{
$ServerData = new stdClass;
set_field( $ServerData ,
'href' , $SavePath );
set_field( $ServerData ,
'original_file_name' , $OriginalFileName );
print_r( $JSON->encode( $ServerData ) );
}
catch( Exception $e )
{
}
}
| handle_request |
( |
& |
$Options | ) |
|
Function processes request.
- Parameters
-
- Returns
- array( $save_path , $file_name , $original_file_name ).
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 202 of file file_input_controller.php.
{
try
{
$extension_whitelist = $this->FileInputAlgorithms->get_extensions(
$Options->get_setting( 'file_types' , 'default' )
);
$DirectoryPath = $PackagePath.'/data/'.date( 'Ymd' );
$save_path = $DirectoryPath.'/';
define( 'NO_DIRECT_CALL' , 1 );
require_once( $PackagePath.'/include/php/upload.php' );
return( array( $save_path , $file_name , $original_file_name ) );
}
catch( Exception $e )
{
}
}
| save_uploaded_file |
( |
|
$SavePath, |
|
|
|
$FileName, |
|
|
|
$OriginalFileName |
|
) |
| |
Function returns a list of the uploading files.
- Parameters
-
| $SavePath | - Destination path. |
| $FileName | - New file name. |
| $OriginalFileName | - Original file name. |
- Returns
- id of the uploaded file.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 112 of file file_input_controller.php.
{
try
{
$FileInputAccess =
get_package(
'file_input::file_input_access' ,
'last' , __FILE__ );
$Record = array( 'file_path' => $SavePath.$FileName , 'original_file_name' => $OriginalFileName );
$id = $FileInputAccess->create( $Record );
$EventManager =
get_package(
'event_manager' ,
'last' , __FILE__ );
$EventManager->trigger_event( 'on_load_file' , array( 'id' => $id ) );
$Record[ 'id' ] = $id;
$this->UploadedFile = $Record;
return( $id );
}
catch( Exception $e )
{
}
}
| upload_file |
( |
& |
$Options | ) |
|
Function uploads file.
- Parameters
-
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 248 of file file_input_controller.php.
{
try
{
$VarName = $this->Security->get_gp( 'page_name' , 'command' ).'_file';
if( $Options->get_setting( 'var_name' , false ) !== false )
{
$VarName = $Options->get_setting( 'var_name' );
}
$this->Security->set_s( $VarName , $id );
}
catch( Exception $e )
{
}
}
Field Documentation
| $FileInputAlgorithms = false |
The documentation for this class was generated from the following file: