Upload file via client method not working

Hi, I am using the client method given in the documentation to upload file in Aras : 

function processAddingFile(file) {
    var newFile = aras.newItem("File", file);
    if (newFile) {
        aras.itemsCache.addItem(newFile);
        var res = aras.saveItemEx(newFile);
        aras.unlockItemEx(res);
    }
}
aras.vault.selectFile().then(processAddingFile.bind(this));

 I attached this method to a button. When I click on the button and select the file I want to upload, I got this error : 

Error: Use the asynchronous file upload method/way

at Aras.Aras_applyItemWithFilesCheck [as applyItemWithFilesCheck] (include.aspx?classesurnBlocker:28343:10)

at Aras.Aras_saveItemEx [as saveItemEx] (include.aspx?classesurnBlocker:29949:18)

at HTMLInputElement.processAddingFile (virtualGetForm?formI5cf&mode=add:669:10)

Do you have an idea why I am getting this error ?


Thank you!

Parents Reply Children
No Data