classUploadFile{publicString imageUrl;}@PostMapping(path ="/files/upload/image/by/angular-editor", consumes =MediaType.MULTIPART_FORM_DATA_VALUE, produces =MediaType.APPLICATION_JSON_VALUE)publicUploadFileuploadImageByAngularEditor(@RequestPart("file")MultipartFile file
){// using your own service to save file...// this is the image URLString imageUrl ="your image url";UploadFile response =newUploadFile(); response.setImageUrl(imageUrl);return response;}
Backend - your system
Create Post API that handle input and return output adapt:
Input: MultipartFile that have file field in request
Ouput: return json that have imageUrl field like this { imageUrl: "" }
Explain
When set uploadUrl in fontend => every time you click upload image it will send a post request to uploadUrl
That request have MultipartFile in request, it expected to receive {"image Url": ""} in response