Sign in to Community
Sign in to view all badges
We have come across below requirement:
1) We have HTML form with few input fields along with File upload option.
2) Once we submit form, It should call POST rest API and pass on all parameters along with file in some way and based on API response, we need to display messages.
Do we have any reference or example for this one?
Please find below steps to pass file input.
Pass this file input in rest API ajax request as request parameter.
fileInput : $('#file-input').files
Backend Servlet :
RequestParameter uploadedFile = request.getRequestParameter("fileInput");InputStream inputStream = uploadedFile.getInputStream();
Hi @arvind ,
Here are few links which can be helpful in performing Rest POST calls with parameters and files.
Please follow below article to achieve your requirement.