73 $this->FileInputAlgorithms =
get_package(
'file_input::file_input_algorithms' ,
'last' , __FILE__ );
74 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
116 $FileInputAccess =
get_package(
'file_input::file_input_access' ,
'last' , __FILE__ );
118 $Record = array(
'file_path' => $SavePath.$FileName ,
'original_file_name' => $OriginalFileName );
119 $id = $FileInputAccess->create( $Record );
121 $EventManager =
get_package(
'event_manager' ,
'last' , __FILE__ );
122 $EventManager->trigger_event(
'on_load_file' , array(
'id' => $id ) );
124 $Record[
'id' ] = $id;
126 $this->UploadedFile = $Record;
130 catch( Exception $e )
166 $ServerData =
new stdClass;
167 set_field( $ServerData ,
'href' , $SavePath );
168 set_field( $ServerData ,
'id' , $FileId );
169 set_field( $ServerData ,
'original_file_name' , $OriginalFileName );
172 print_r( $JSON->encode( $ServerData ) );
174 catch( Exception $e )
207 $extension_whitelist = $this->FileInputAlgorithms->get_extensions(
208 $Options->get_setting(
'file_types' ,
'default' )
212 $DirectoryPath = $PackagePath.
'/data/'.date(
'Ymd' );
216 $save_path = $DirectoryPath.
'/';
219 define(
'NO_DIRECT_CALL' , 1 );
220 require_once( $PackagePath.
'/include/php/upload.php' );
222 return( array( $save_path , $file_name , $original_file_name ) );
224 catch( Exception $e )
256 $VarName = $this->Security->get_gp(
'page_name' ,
'command' ).
'_file';
257 if( $Options->get_setting(
'var_name' ,
false ) !== false )
259 $VarName = $Options->get_setting(
'var_name' );
262 $this->Security->set_s( $VarName , $id );
266 catch( Exception $e )
294 $UploadFile = $Options->get_setting(
'upload_file' ,
false );
295 $NotDirectControllerCall = $this->Security->get_s(
'direct_controller' ,
'integer' , 0 ) == 0;
297 if( $UploadFile && $NotDirectControllerCall && count( $_FILES ) )
302 catch( Exception $e )