Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Validate 1
Level 1
fir89
Level 1

Like

1 like

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
fir89
Level 1

Like

1 like

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
fir89
Level 1

08-01-2018

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?

Replies

Avatar

Avatar
Ignite 5
Employee
workflowuser
Employee

Likes

133 likes

Total Posts

443 posts

Correct Reply

70 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 50
Give Back 5
View profile

Avatar
Ignite 5
Employee
workflowuser
Employee

Likes

133 likes

Total Posts

443 posts

Correct Reply

70 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 50
Give Back 5
View profile
workflowuser
Employee

09-01-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

Avatar

Avatar
Validate 1
Level 1
fir89
Level 1

Like

1 like

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
fir89
Level 1

Like

1 like

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
fir89
Level 1

09-01-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.

Avatar

Avatar
Boost 1
Level 2
Anish_Somani
Level 2

Like

1 like

Total Posts

19 posts

Correct Reply

4 solutions
Top badges earned
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 1
Level 2
Anish_Somani
Level 2

Like

1 like

Total Posts

19 posts

Correct Reply

4 solutions
Top badges earned
Boost 1
Affirm 3
Affirm 1
View profile
Anish_Somani
Level 2

14-01-2018