Skip to content

Instantly share code, notes, and snippets.

View varaprasadh's full-sized avatar
:electron:
Rewinding the wires from scratch!

consious_coder varaprasadh

:electron:
Rewinding the wires from scratch!
View GitHub Profile
package dev.varaprasadh.app;
import org.springframework.http.MediaType;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.math.BigInteger;
File file = new ClassPathResource("logo.png").getFile();
HTTPRequestMultipartBody multipartBody = new HTTPRequestMultipartBody.Builder()
.addPart("name", request.getName())
.addPart("file", request.getFile(), request.getFile().getContentType(), request.getFile().getOriginalFilename())
.addPart("file1", file, null , request.getFile().getOriginalFilename())
.build();