Check documentation for the latest version of dhtmlxSuite onUploadFail DHTMLX Docs

onUploadFail

fires when uploading of the file has failed

void onUploadFail(object file,object extra){ ... };

Parameters

fileobjectan object with file details
extraobjectoptional, an object with extra information from server

Example

myVault.attachEvent("onUploadFail", function(file, extra){
 
    // file is an object with details
    {
        id:                 123,            // number, internal file ID
        name:               "fname.ext",    // string, filename detected by browser
        serverName:         "fname2.ext",   // string, filename returned by server
        lastModifiedDate:   Date,           // date object if retrieved (1)
        size:               132500,         // number, file size in bytes
        uploaded:           false,          // boolean, true/false
        error:              true            // boolean, error while uploading, if any
    }
 
    // extra - sends extra information from the server to the client
    // assuming that server returns the following json:
    {
        state:  false,
        name:   "filename.jpg",
        extra:  {
                    info:   "just a way to send some extra data",
                    param:  "some value here"
                }
    }
 
    // then extra on client will be:
    {
        info:   "just a way to send some extra data",
        param:  "some value here"
    }
 
});

Related samples

Details

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.

  • size in html4 mode is available only after the file has been uploaded
  • serverName is available only after the file has been uploaded
  • (1) works in html4/html5/flash modes, Chrome/Opera/Safari/FF/IE11/IE10
See also
Change log
  • added in version 2.0
  • lastModifiedDate attribute added in 2.3
Back to top