Basically, it sounds like you need to build REST-based Web Service that can receive http requests with attachments. I assume that you already have a commercial Web Server (like Apache) where you can authenticate requests to your system and set up SSL certification if needed.
/// Set this property from onInit() in your Service class to make the adapter parse form variables from the form body in case of a form POST Property ParseBodyFormVars As %Boolean;
So you just need to implement the OnInit() method as described here:
I think the first post may be all you need... just put the upload part into the OnProcessnput() of your custom business service. You can also see similar code in the 2nd article, when you scroll to where it talks about form data.
Thanks @Vitaly Furman by detailed instructions, but I need a sample where I receive a file uploaded by user using an REST API with formdata mode and get objectscript reference to this file. In your samples, the first refers to the documentation, thats don't have file upload sample and in the second, the sample is about a custom cache project, not about ensemble.
It is because this business service will be a PEX service, so it will are depends with an external rest service, and it limits your reusability. In my service I have the file yet, but I don't know how to extract file inside the globalbinary variable. But if did not have alternative, I will create de REST service.
Is your use case such that someone is posting data to your Server? If you use Ensemble, you probably benefit by reading: https://cedocs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=EHTTP_preface
If you use Cache Web Services and you are building a custom REST-based service, please read: https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GREST_services
Basically, it sounds like you need to build REST-based Web Service that can receive http requests with attachments. I assume that you already have a commercial Web Server (like Apache) where you can authenticate requests to your system and set up SSL certification if needed.
I will use Ensenble, but official documentation has only simple sample to get an id value only. I need a upload file sample.
I am seeing this in EnsLib.HPPT.InboundAdapter:
Property ParseBodyFormVars As %Boolean;
So you just need to implement the OnInit() method as described here:
https://cedocs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=EHTT...
I realize that the docs provide very little... just looked through them myself. So I found more posts that you might find helpful:
https://community.intersystems.com/post/uploading-and-downloading-files-...
https://community.intersystems.com/post/restful-way-data-transfer
I think the first post may be all you need... just put the upload part into the OnProcessnput() of your custom business service. You can also see similar code in the 2nd article, when you scroll to where it talks about form data.
Good luck!
Thanks @Vitaly Furman by detailed instructions, but I need a sample where I receive a file uploaded by user using an REST API with formdata mode and get objectscript reference to this file. In your samples, the first refers to the documentation, thats don't have file upload sample and in the second, the sample is about a custom cache project, not about ensemble.
Here's how you can create a REST API and call production from it.
Inside your REST handler you can access request body via:
Here's a simple fileserver in ObjectScript.
Thanks! So ensenble don't have suport to multipart right?
It does, but %CSP.REST is a preferable way of handling REST Requests.
As you can easily call production from REST just do it whenever the need arises.
It is because this business service will be a PEX service, so it will are depends with an external rest service, and it limits your reusability. In my service I have the file yet, but I don't know how to extract file inside the globalbinary variable. But if did not have alternative, I will create de REST service.
IIRC you're doing Tesseract OCR - in that case I would recommend the following architecture:
Resolved: https://community.intersystems.com/post/extract-file-multipart-form-or-api-using-readmimemessage
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue