Warning: include_once(/home/loudcanv/public_html/includes/location_functions.php): failed to open stream: Permission denied in /home/ajaxcrud/public_html/preheader.php on line 44

Warning: include_once(): Failed opening '/home/loudcanv/public_html/includes/location_functions.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ajaxcrud/public_html/preheader.php on line 44
ajaxCRUD.com » ajaxCRUD API :: onFileUploadExecuteCallBackFunction - Use PHP & AJAX to CRUD from a mysql database table (create / read / update / delete)

ajaxCRUD.com

» a PHP class to Create, Read, Update, & Delete from a mysql database table using AJAX

   by loud canvas media

AjaxCRUD Class Documentation / Reference Material

<< Reference overview
<< Home

onFileUploadExecuteCallBackFunction

calls a local function when a file is uploaded
void onFileUploadExecuteCallBackFunction ( String functionName )

use this function when you want to apply certain logic (or display a certain message) when a file is uploaded. Use of this function is similiar in a way to a java interface: you must define a function with the name specifed in the function call.

This function must take ONE parameter (an array). The indexes of this array are as follows:

  • id (the id of the row for which the file was uploaded)
  • (your primary key) (the id of the row for which the file was uploaded)
  • field (the fieldname to which the file was uploaded [the filename was placed in this field: see setFileUpload])
  • fileName (the name of the file) [may have been renamed]
  • fileSize (the filesize of the file)
  • fldType (the filetype of the file)

  • Details

    Requires setFileUpload, your callback function
    Type function
    Returns void

    Parameters

    functionName
    name of the local function to be invoked when a file is uploaded

    Example

    
    $demo->setFileUpload("fldFilename");
    $demo->onFileUploadExecuteCallBackFunction("uploadDocument");
    
    function uploadDocument($array){
      $id         = $array[id];  //this will always be the value
      $id         = $array[pkID]; //same as above IF the pk is pkID
      $fileName   = $array[fileName];
      $fileSize   = $array[fileSize];
      $fileType   = $array[fldType];
      
      if ($fileName != ''){
        $success = qr("UPDATE tblDemo SET fldFilesize = '$fileSize'
                                      WHERE pkDemoID = $id");
      }
    }
    

    See also

    New, Edit

     

    "Great api. Really love the demo. "
    ~Ade

    What is a business/commercial website?

    A commercial website is one created for a business, for which purpose is generating revenue or cash flow of any type (and that isn't under a non-profit organization). So if you're selling a product, selling advertisement, selling a service, or just marketing a commercial business, your site is commercial. A company website is also commercial even if it doesn't sell anything, as it's purpose is to front a commercial company.
    Close