Forum Discussion
http.request.parameters.name.get is for normal http post and get, not for multipart. Not sure about the freemarker syntax for endpoint. You may need professional service to do the file upload at Java Level. Please correct me if I am wrong.
VarunGrazitti Can you give a user case? Maybe we can tackle it in another way.
- manpreetsingh9 years agoContributor
Hi peterlu,
Use case is:
We want to upload an attachment from component to our server that is providing us a third party api (multipart support). In that case we need to develop a component and EndPoint in lithium from where we can push our attachment.Explanation and requirement: We want to hit our third party api via lithium EndPoint and not directly from lithium component, so our problem is how do we upload an attachment from lithium component via Endpoint to that server?
Other options: multipart approach requires form data, but if we are not using multipart then we can convert the attachment into base 64 string but in that case it exceeds its limit if the attachment is large in size.
Any help will be appreciated !
- peterlu9 years agoChampion
manpreetsingh if the attachment is small, you can base64 encode it, and send to endpoint. (Please check bowen's answer for angular usage). Then you can use http client in endpoint to post to your thirt party server.
But if the attachment is big, then it may not work properly. You may need to limit the file size by frontend checking. And also you need to check the base64 string size at the endpoint.
Endpoint may not work for your case if you cannot predict the file size. You may need professional service to help you write the java object at a lower level.
- KevinSaquing6 years agoAce
Having the same issue. Any updates on this?
Related Content
- 5 years ago
- 11 years ago