Probably it is a ridiculous question but I wonder the answer. I wrote an endpoint to get a file to save it to aws s3 as:
@PostMapping("/media")
@Operation(summary = "Save Media", security = @SecurityRequirement(name = "BearerJWT"))
public ResponseEntity<MediaDto> saveMedia(@RequestPart("file") MultipartFile file, @RequestPart("MediaDto") MediaDto MediaDto) {
return ResponseEntity.ok(mediaService.saveMedia(MediaDto, file));
}
The code is working good. I just want to add this file to s3 in my service class and it is ok too but whenever I send a file to this endpoint than the project is saving the file into the project folders.
1-On my local, is it something normal or can I stop this saving and just use it in service method and skip it ? Should I delete the file manually or delete it via code ?
2-More serious question mark in my mind is that I get build jar file from the project and deploying it to the server and it is running on server from a jar file. What is happening when I send file to this endpoint on server ? Is the server is still saving the file in somewhere on server or just process it and skip it ?