Questions tagged [multipartfile]

127 questions
1
vote
1 answer

Problem while uploading MultiValueMap using FeignClient for MultipartFile receiver API

I am facing issues while sending MultipartFile from one service to another service. API which I want to call is, @PostMapping(value = "/posts/{postId}/comments/{commentId}/attachments") @JsonView(CaseJsonView.ClientWithComments.class) public…
1
vote
0 answers

Spring Boot Controller function not terminating or returning when creating an apache poi workbook from MultipartFile

So I am trying to send a file and an object to my Backend. I then use the Multipartfile to create an Apache Poi Workbook. Using apache's Iterator I loop over the file, extracting and saving what I need. That is working well (it even is saving the…
himmels
  • 21
  • 3
1
vote
1 answer

How to load a local file using MultipartFile in spring boot

How to consume an API which accepts only MultipartFile in spring boot? Have to pass a file from Local Server (from some specific path) @FeignClient(name = "abc-file-upload",url ="https://abc.xyz.app") public interface ABCFeignClient { String…
1
vote
1 answer

Test POST request with multipartfile with Spring

I have a controller sending post requests which is working well and communicating with the client correctly. However, I am unable to test it with in JUnit. The controller receives a multipartfile, along with 2 boolean parameters (that are required),…
LaChope
  • 183
  • 1
  • 2
  • 14
1
vote
1 answer

How to send request to backend spring rest controller with a json requestbody and request param as a multipart image file

I am writing a backend api which consumes a json request with multipart image files. I am unable to figure out a way to do so. Anyone, faced and found a solution to a problem similar to mine...???
1
vote
0 answers

Android File upload with Multipart Retrofit and java Rest api

Could you please help me with the Multipart Retrofit file upload with backend java rest api(mysql db). I tried with the below code but it is not working.. Retrofit part Activity.java private void checkingst(File file){ RequestBody requestBody =…
Sanjeev
  • 21
  • 2
1
vote
2 answers

Spring boot file multipart accept half allowed size

I wrote a controller as below: @PostMapping(value="/upload", produces = "application/json") @ApiOperation("Upload") @ApiIgnore public ResponseEntity fileUpload( @RequestParam(value="file") MultipartFile file, …
SpongeBob
  • 383
  • 3
  • 16
1
vote
0 answers

How to handle image upload to database with MultipartFile and BindingResult

I'm currently trying to send data from a form (name, password, image) etc. I'm using Spring Boot, JPA, Thymeleaf and MultipartFile, but I'm having the following error: Failed to convert property value of type…
purenoob
  • 21
  • 2
1
vote
0 answers

Fail convert multipart file to string in spring boot

This is error message: org.springframework.validation.BeanPropertyBindingResult: 1 errors Field error in object 'post' on field 'thumbnail': rejected value…
Tuyen Vo
  • 11
  • 1
0
votes
0 answers

Save the (String) path to the file located on local HDD

How to save the (String) path to the file or folder located on local HDD using Java/SpringBoot/Thymeleaf? Is it possible at all? I use MultiPartFile to upload selected file, but I can't access the original file path in the controller. I tried…
0
votes
0 answers

Springboot CodeQL Issue

While Uploading Multipart file I am getting CodeQL issue. Controller Code: @PostMapping("/uploadTraining/{organizationID}/{userID}") UploadTrainingResult uploadTraining(@RequestParam("file") MultipartFile fname, …
0
votes
0 answers

How to convert Spring MultipartFile type to RestEasy MultipartFormDataInput type

Currently I have a RestEasy API that receives a parameter of type MultiPartFormDataInput in a POST request. However there is a new Spring Controller that we want to use that will leverage this previous RESTEasy Controller i.e. the RestEasy…
Georgi Velev
  • 166
  • 10
0
votes
1 answer

Validate MultipartFile list size

I need to limit the number of MultipartFiles sent to Spring Rest API. The annotations from jakarta.validation.constraints don't work for List files for some reason, but they do work for lists of other objects, such as List
tabool
  • 89
  • 9
0
votes
0 answers

Sending CSV file via WebClient : No serializer found for class sun.nio.ch.ChannelInputStream and no properties discovered to create BeanSerializer

I'm trying to Send a Multipart File using WebClient : public Mono uploadOffers(MultipartFile file) { return this.offerWebClient.getOfferWebClient(WebClient.builder()).post() …
0
votes
0 answers

Cannot convert MultipartFile to Byte[] , thymeleaf problem or java problem?

i have this errore since few weeks now... I-m trying to upload an image from my html template to BD... i have this error: 2023-07-04 12:42:00.503 WARN 18708 --- [nio-8080-exec-6] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved…
1 2 3
8 9