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

Subscribe to our news:
Partners
Testimonials
Steve Morton: "First let me thank you for making this application Free. Best deal I have ever see for what it does".
Jonathan Oakes: "This is a lovely application. It's easy to hook into my own bespoke applications. It's very powerful, yet really quite simple to use. Thanks for this".

More

Add your opinion

PHP Generator for MySQL 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