title: React Native + Spring Boot upload image error
body: <p>I'm trying to upload image to spring boot server.</p>
  <p>But i get error</p>
  <blockquote>
  <p>Required request parameter 'info' for method parameter type
  MemberInfoDto is not present</p>
  </blockquote>
  <p>When i removed info, 'image' is not present error is occured.</p>
  <p>What is wrong with my code?</p>
  <p>Below is RN code</p>
  <pre><code>export async function postMultipartData(url, data, file) {
  
      let _headers = await headers()
      _headers = Object.assign(_headers, {
          'Content-Type': 'multipart/form-data;boundary=gc0p4Jq0M2Yt08jU534c0p',
      })
    
      let formData = new FormData()
  
      formData.append(
          &quot;info&quot;,
          JSON.stringify(data)
      );
  
      if (file) {
          if (Array.isArray(file)) {
              for (let i = 0; i &lt; file.length; i++) {
                  const v = file[i];
                  const fileNames = v.filename.split('.');
                  const ext = fileNames[fileNames.length - 1];
          
                  formData.append('images', {
                    name: v.filename,
                    type: `image/${ext}`,
                    uri: v.uri,
                  });
                }
          } else {
              const filePath = file.split('.');
              const ext = filePath[filePath.length - 1];
    
              formData.append('image', {
                name: `image.${ext}`,
                type: `image/${ext}`,
                uri: file,
              }
              );
          }
  
      }
  
      return axiosInstance.post(`${url}`, formData, {
          headers: _headers
      }).then(res =&gt; {
          return res.data
      }).catch(error =&gt; {
          return error
      })
  }
  </code></pre>
  <p>data param looks like</p>
  <pre><code>{
    gender: gender, // string
    birthDate: birthday, // date
    languages: language, // array
  }
  </code></pre>
  <p>And Spring Controller Code</p>
  <pre><code>  @PostMapping(value = &quot;/saveAdditionalInfo&quot;)
    public void saveAdditionalInfo(@RequestParam(value = &quot;info&quot;) MemberInfoDto MemberInfoDto, @RequestParam(value = &quot;image&quot;) MultipartFile image) throws IOException  {
          ~~~
    }
  </code></pre>
  <p>MemberInfoDto is</p>
  <pre><code>@Data
  @RequiredArgsConstructor
  public class MemberInfoDto {
      private String gender;
      private LocalDate birthDate;
      private String[] languages;
  }
  </code></pre>
  <p>And RN Form Data post</p>
  <pre><code>{
    &quot;_parts&quot;: [
      [
        &quot;info&quot;,
        {
          &quot;gender&quot;: &quot;female&quot;,
          &quot;birthday&quot;: &quot;1997-12-31T15:00:00.000Z&quot;,
          &quot;languages&quot;: [
            &quot;english&quot;,
            &quot;spanish&quot;
          ]
        }
      ],
      [
        &quot;image&quot;,
        {
          &quot;name&quot;: &quot;image.jpg&quot;,
          &quot;type&quot;: &quot;image/jpg&quot;,
          &quot;uri&quot;: &quot;file:///Users/tom/Library/Developer/CoreSimulator/Devices/B5075DC8-EB94-442D-8385-0ED076E823FE/data/Containers/Data/Application/9B66D793-0BBA-4555-AAA8-08F3D2061FD2/tmp/A89EF802-6289-4011-A958-23FD9E73FAA7.jpg&quot;
        }
      ]
    ]
  }
  </code></pre>