Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
John Gondek: "Your software is amazing. I consider myself a novice at PHP and JS and with your software I have a web page that is truly fantastic. Thank you so much ".
Simon Greener: "A lot of work went in to designing our application database. PHP Generator allowed us to build a fully functional, professional looking, and functionally powerful web application from that database. It has freed us from worrying about low level code, enabling us to focus on the business requirements of the customer. The support provided is excellent with staff quickly producing answers to questions ranging from newbie to simple or complex. I highly recommend the product".

More

Add your opinion

PostgreSQL PHP Generator online Help

Prev Return to chapter overview Next

OnFileUpload

This event allows you to control file uploading. It fires on uploading a file with Upload file to folder and Upload image to folder editors.

 

Signature:

function OnFileUpload($fieldName, &$result, &$accept, $originalFileName,
                       $originalFileExtension, $fileSize, $tempFileName)

 

Parameters:

$fieldName

The name of currently processed column.

$rowData

The associative array of values that corresponds to the currently processed row.

$result

The actual file name (with full path). Change the value of this parameter to customize the filename.

$accept

Indicates whether the file uploading is allowed. Default value is true. Set $accept to false to cancel file uploading.

$originalFileName

The original file name (including extension)

$originalFileExtension

The original file extension

$fileSize

The file size

$tempFileName

The temporary filename of the file in which the uploaded file was stored on the server.

 

Example

This example shows how to add current date and time to the uploaded filename.

 

if ($fieldName === 'filename') {

    $newFileName = date('Y-m-d_H-i-s') . "_" . $originalFileName;

    $result = str_replace($originalFileName, $newFileName, $result);

}



Prev Return to chapter overview Next