Using request.getParts() in AEM servlet to get multiple files sent via an AJAX POST
Hi,
I am trying to read multiple files as attachments sent by a POST to my AEM servlet. I need to read each file and then pass them on to a call to AWS Api Gateway.
Looking at the API documentation https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/org/apache/sling/api/SlingHttpServletRequest.html it says it inherits method getParts() from javax.servlet.http.HttpServletRequest.
In http://docs.oracle.com/javaee/6/tutorial/doc/gmhba.html it says I can use something like
Collection<Part> parts = request.getParts("file");
However in Eclipse runing my project on Maven Aem archetype 10, I cannot access Part unless I use Collection<javax.servlet.http.Part> parts but the SlingHttpServletRequest object does not have access to getParts();
Am I approaching this incorrectly in AEM?
I have been working with AEM for 2 years now, but I have never had to read Multiple attachments before.
Regards
Clive Stewart