set_col_fileupload() *

* Please note this feature is currently only available for commercial licenses.

  • Parameters:
    • $col_name: column name that stores file name
    • $base_url: base URL to the files
    • $physical_path: specify the physical path to the folder where the files are uploaded. When PHP is installed as Apache module, this parameter is optional.
  • Description:
    •  The file upload is seamlessly integrated with the edit form using Ajax, no page refresh ever occurred. Files can be uploaded and deleted right within the form.
  • Remark:
    • A single file upload per datagrid is allowed.
    • FORM edit mode only
    • File system only with valid upload_tmp_dir value in php.ini
    • Filename column should allow NULL value
    • $physical_path is automatically obtained if PHP running in Apache module, or MUST be provided as a fallback
    • When receiving alert message “unexpected token <“, it is your upload folder that doesn’t allow write permission. Please set the folder permission to be writable.
    • By default, only JPEG files are allowed for file upload, but one can change the upload file extension to include additional file formats in conf.php called ‘UPLOADEXT
    The 2nd and 3rd parameters are now dropped. Instead the user must set the upload directory value ‘UPLOADDIR’ in conf.php
    X
  • Example:
1
2
3
// conf.php
define('UPLOADEXT', 'gif,png,jpg,jpeg');
define('UPLOADDIR', '/var/www/web/myuploads/');
1
2
// sample_file_upload.php
$dg -> set_col_fileupload("employee_photo");