DHTMLX Docs & Samples Explorer

onBeforeFileAdd

Occurs before the user adds a file to the upload queue.

Parameters:

  • realName - (string) the real name of the file (as it's displayed in the control)
  • size - (int) the size of the file (not supported for html4 mode)
myForm.attachEvent("onBeforeFileAdd ",function(realName, size){
    // any custom logic here
    return true;
});
  • Returning false will cancel the 'add' operation.
  • For example - this event can be used to filter files by the extension.