fires before the user adds a file to the upload queue
file | object | an object with file details |
myVault.attachEvent("onBeforeFileAdd", function(file){
// file is an object with details
{
id: 123, // number, internal file ID
name: "fname.ext", // string, filename detected by browser
lastModifiedDate: Date, // date object if retrieved (1)
size: 132500, // number, file size in bytes
uploaded: true, // boolean, true/false
error: false // boolean, error while uploading (if any)
}
// your code here, for example
if (file.size > 1234567) return false;
return true;
});
This API page is for Vault v2.5. Please go to docs.dhtmlx.com/vault/ to see API reference for the current version of dhtmlxVault.