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 ".
Anley Lafleur: "I cannot wait to start using your exciting product and I am sure it will help me achieve my objectives".

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);

    $handled = true;

}



Prev Return to chapter overview Next