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

Rest API call with File upload

Avatar

Avatar
Boost 3
Level 1
arvind
Level 1

Likes

3 likes

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Boost 3
Validate 1
Boost 1
Applaud 5
View profile

Avatar
Boost 3
Level 1
arvind
Level 1

Likes

3 likes

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Boost 3
Validate 1
Boost 1
Applaud 5
View profile
arvind
Level 1

14-10-2020

Dear Team,

 

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?

 

Regards,

Arvind

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 3
MVP
Manjunath_K
MVP

Likes

139 likes

Total Posts

188 posts

Correct Reply

61 solutions
Top badges earned
Give Back 3
Give Back
Boost 50
Boost 5
Boost 3
View profile

Avatar
Give Back 3
MVP
Manjunath_K
MVP

Likes

139 likes

Total Posts

188 posts

Correct Reply

61 solutions
Top badges earned
Give Back 3
Give Back
Boost 50
Boost 5
Boost 3
View profile
Manjunath_K
MVP

14-10-2020

Hi @arvind 

Please find below steps to pass file input.

 

Javascript

Pass this file input in rest API ajax request as request parameter.

fileInput : $('#file-input')[0].files[0]

 

Backend Servlet :

RequestParameter uploadedFile = request.getRequestParameter("fileInput");
InputStream inputStream = uploadedFile.getInputStream();

 

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
MVP
santhosh_kumark
MVP

Likes

98 likes

Total Posts

111 posts

Correct Reply

38 solutions
Top badges earned
Validate 1
Give Back 3
Give Back
Boost 50
Boost 5
View profile

Avatar
Validate 1
MVP
santhosh_kumark
MVP

Likes

98 likes

Total Posts

111 posts

Correct Reply

38 solutions
Top badges earned
Validate 1
Give Back 3
Give Back
Boost 50
Boost 5
View profile
santhosh_kumark
MVP

14-10-2020

Avatar

Avatar
Validate 1
Level 4
Sandeep6
Level 4

Likes

56 likes

Total Posts

66 posts

Correct Reply

15 solutions
Top badges earned
Validate 1
Give Back
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 4
Sandeep6
Level 4

Likes

56 likes

Total Posts

66 posts

Correct Reply

15 solutions
Top badges earned
Validate 1
Give Back
Boost 50
Boost 5
Boost 3
View profile
Sandeep6
Level 4

14-10-2020

Hi @arvind ,

 

Please follow below article to achieve your requirement.

 

 https://helpx.adobe.com/experience-manager/using/upload_experience_manager_dam.html 

 

Thanks,

Sandeep.