61 $this->FileInputAccess =
get_package(
'file_input::file_input_access' ,
'last' , __FILE__ );
62 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
64 $this->Extensions[
'default' ] = array(
'jpg' ,
'jpeg' ,
'gif' ,
'bmp' ,
'png' ,
'tif' ,
65 'tiff' ,
'doc' ,
'docx' ,
'ppt' ,
'pptx' ,
'rtf' ,
'xls' ,
'xslx' ,
'pdf'
68 $this->Extensions[
'images' ] = array(
69 'jpg' ,
'jpeg' ,
'gif' ,
'bmp' ,
'png' ,
'tiff' ,
'tif'
72 $this->Extensions[
'archives' ] = array(
73 'zip' ,
'7zip' ,
'gz' ,
'gz2' ,
'tar' ,
'rar' ,
'arc'
76 $this->Extensions[
'all' ] = array(
'*' );
116 if( isset( $this->Extensions[ $Type ] ) ===
false )
118 throw(
new Exception(
"File type \"$Type\" is undefined" ) );
122 $AsString ?
'*.'.implode(
';*.' , $this->Extensions[ $Type ] ) : $this->Extensions[ $Type ]
125 catch( Exception $e )
159 if( $Type ==
'default' )
161 $FileDescription =
'Supported types';
163 elseif( $Type ==
'images' )
165 $FileDescription =
'Images';
167 elseif( $Type ==
'archives' )
169 $FileDescription =
'Zip archives';
171 elseif( $Type ==
'all' )
173 $FileDescription =
'All files';
176 return( array( $FileExtensions , $FileDescription ) );
178 catch( Exception $e )
210 $id = $this->Security->get( $id ,
'integer' );
212 $Records = $this->FileInputAccess->unsafe_select(
"id = $id" );
214 if( count( $Records ) !== 1 )
216 throw(
new Exception(
'An error occured while record fetching' ) );
220 return( $Records[ 0 ] );
223 catch( Exception $e )