I see this in the examples for using a pretty html5 file upload in client-side javascript of Share of the Alfresco Community version.
I try to use it as per instructions:
this.widgets.myWidget = Alfresco.component.getDNDUploadInstance();
Unfortunately, I get an error:
Uncaught TypeError: Object #<Object> has no method 'getDNDUploadInstance'
What am I missing here? Do I need some dependencies? I included alfresco.js, alfresco-dnd.js to my Share dashlet.
I think the code snippet included in the class JSDoc may be out of date.
Since the class
Alfresco.DNDUploadseems to implement the capabilities, you should be able to use something likeYour
elidshould contain the ID of the Dom element that you are going to render the upload component into – you may find that you need to predefine some markup within there. The expressionargs.htmlidis normally used to supply the value in your web script.You should also check out the parameters supported by the
show()method (docs). I could not see afilesparameter listed so I removed this, but you should review the other values you supply in order to ensure you are specifying appropriate values.If you need further reference material then check out the
dnd-upload.getweb script (source dir).