Public Method Details |
FileDB |
public void FileDB( Object &$db, String $host, String $database, String $user, String $password )
|
|
Constructor
Opens the connection to the db
|
Parameter |
|
|
|
|
|
|
|
|
|
|
Returns |
void |
|
add |
public boolean add( String $file_name, [ String $file_descr ] )
|
|
Adds file to the db
Adds file to the db and increases the file count
|
Parameter |
|
|
|
String |
$file_descr |
= >>''<< |
|
|
|
Returns |
boolean TRUE if successful |
|
edit |
public boolean edit( Array $array )
|
|
Edits file data
Edits an entry in the db
|
Parameter |
|
Array |
$array |
|
|
array(
"id" => the identifier *
"file_name" => name of the file
"file_descr" => description of the file
"bin_data" => file data
"hits" => number of downloads
)
(*) is mandatory |
|
Returns |
boolean TRUE if successful |
|
remove |
public boolean remove( Integer $id )
|
|
Removes file to the db
Removes file and decreass file count
|
Parameter |
|
|
Returns |
boolean TRUE if successful |
|
sendFile |
public boolean sendFile( Integer $id, [ String $contentType ] )
|
|
Creates user download dialog
Sends the file to the user, should be called in an empty page
|
Parameter |
|
|
|
String |
$contentType |
= >>'application/save'<< |
|
|
|
Returns |
boolean FALSE on error |
|
get |
public mixed get( Integer $id, [ boolean $addHit ] )
|
|
Returns the full file information
Returns the full file information
|
Parameter |
|
|
|
boolean |
$addHit |
= >>true<< |
|
|
|
Returns |
mixed an Array or FALSE if an error occurs |
|
getWhere |
public mixed getWhere( String $select, [ String $where, boolean $addHit ] )
|
|
Returns specified file information
Free definable select and where clauses for file information
|
Parameter |
|
|
|
|
|
boolean |
$addHit |
= >>true<< |
|
|
|
Returns |
mixed an Array or FALSE if an error occurs |
|
getFile |
public mixed getFile( Integer $id, [ boolean $addHit ] )
|
|
Returns the binary file data
Returns the binary file data
|
Parameter |
|
|
|
boolean |
$addHit |
= >>true<< |
|
|
|
Returns |
mixed a String or FALSE if an error occurs |
|
getFileData |
public mixed getFileData( Integer $id )
|
|
Returns the file information
Returns the file information without the binary data
|
Parameter |
|
|
Returns |
mixed a String or FALSE if an error occurs |
|
getIds |
public mixed getIds( )
|
|
Returns all file ids
Returns an array with all file ids
|
Returns |
mixed an Array or FALSE if an error occurs |
|