In order to upload files into a Servoy solution using a custom webcomponent here are the steps you should do :
add a dataprovider type to the component spec, with 'pushToServer' support and 'ondatachange' callback:
"file": {"type": "dataprovider", "pushToServer": "allow", "ondatachange": { "onchange":"onDataChangeMethodID", "callback":"onDataChangeCallback"}} |
add an 'ondatachange' handler to the component spec:
"onDataChangeMethodID" : { "returns": "Boolean", "parameters":[ { "name":"oldValue", "type":"${dataproviderType}" }, { "name":"newValue", "type":"${dataproviderType}" }, { "name":"event", "type":"JSEvent" } ] } |
<form action="resources/upload/35400153-e5d3-41cb-8032-3b4f91459aca/test/fileupload/file" method="post" enctype="multipart/form-data"> |