Usage of Adaptive Form's File Upload and "getFileAttachmentsInfo" | Community
Skip to main content
fir89
January 8, 2018

Usage of Adaptive Form's File Upload and "getFileAttachmentsInfo"

  • January 8, 2018
  • 1 reply
  • 4138 views

Currently building an adaptive form with textboxes and file upload as input.

After a button click, I would like to pass the files added into the File Upload component onto the Servlet via AJAX call.

I added the code below (into code editor) to send the path of the files within CRX into the servlet for further processing.

guideBridge.getFileAttachmentsInfo({

//this code will produce bugs

  success:function(list) {

     //ajax code to call servlet

}

});

Is using "getFileAttachmentsInfo" a good approach?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Adobe Employee
January 9, 2018

Why not submit the form to REST endpoint ? In the payload you will have access to the attachments

Sending the file path is not recommended

fir89
fir89Author
January 9, 2018

Thanks for the response. I am unfamiliar with AEM in general.

After page submission, the user will be directed to another page, which must hold the newly-generated unique ID of the previous submission. At this point, further inputs from the user will be required.

I noticed that I could redirect using the "Redirect URL/Path" config in AEM Forms. However, it does not seem that I could retrieve the response from the server and pass it to the next page. Therefore, I used the code above to process the data, retrieve the response and redirect manually.

Appreciate if you could guide me on your alternative. Thanks.

Anish_Somani
Level 2
January 14, 2018