Hi, Im created a service for upload file exactly the way i find in ElFinder.xml in moqui.
When i get file via this service
<service verb="get" noun="file">
<in-parameters>
<parameter name="fileId"/>
<parameter name="form"/>
<parameter name="name"/>
</in-parameters>
<actions>
<if condition="!fileId">
<then>
<entity-find-one entity-name="moqui.test.File" value-field="fileMp">
<field-map field-name="name" from="name"/>
</entity-find-one>
<if condition="!fileMp">
<entity-find-one entity-name="moqui.test.File" value-field="fileMp">
<field-map field-name="name" from="'-'+name"/>
</entity-find-one>
</if>
</then>
<else>
<entity-find-one entity-name="moqui.test.File" value-field="fileMp">
<field-map field-name="fileId" from="fileId"/>
</entity-find-one>
</else>
</if>
<script>
def fileLoc = fileMp.location
if(fileLoc.indexOf("file://")!=-1){
fileLoc = fileMp.location.split("file://")[1]
}
ec.web.sendResourceResponse(fileLoc)
return;
</script>
</actions>
</service>
I get above error. why this error happen and how should i fix this?
Thanks