Get Free Trial

How can I save the report as a Multipart file.

gssspillai asked on August 30, 2021

I’m using angular and spring boot. And I want to save the report in server. So I tried MultipartFile in the spring boot controller to store request params and file is not saving. So is there any better way to do it? or is there any default format for RequestParms?
Here is my code
.ts file
function reportSaveHandler() {
                filename: ‘myreport.json’,
                destination: ‘server’,
                url: ‘http://localhost:8082/reports/uploadFile’,
                    ‘Authorization’:’Bearer ‘+token,
.java File (controller)
public class ReportsController {
@RequestMapping(method = RequestMethod.POST,value = “/uploadFile”)
public void uploadReports(MultipartFile file) {
I’m getting nullpointerException while printing. 

1 answer

Illia Yatsyshyn Illia Yatsyshyn Flexmonster August 30, 2021

Thank you for posting on our forum.
Please note that when saving files, Flexmonster is only responsible for preparing the report and sending it to the specified URL in JSON format. Further handling depends on the server-side stack and cannot be affected from our side.
We recommend checking out the following StackOverflow thread describing a similar problem: java – Spring Boot MultipartFile always has value of null.
Alternatively, you can retrieve the inline JSON object representing the report using the getReport method. Next, it can be sent to your server-side manually in the desired way.
We hope it helps.
Kind regards,

Please login or Register to Submit Answer