I use crop utility to resize pictures and it transform image data as Base64 String.
-----------------------------27138656916051
Content-Disposition: form-data; name="typePhoto"
string
-----------------------------27138656916051
Content-Disposition: form-data; name="imageData"
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAfZ0lEQVR4nO2deXAUZfrHn1xkwgyRBEi4hbjAci4gp4gIhAWKy3IXLFgwBYKAEeVeCCvrz4NlAZFFYEPA4JLIJQoChiMi54olhENANOEK1wKGM5AIOb6
/P1Ld9sz09Ez3+04I8HyqupLp6X6et3v6M9PHexAYhvEIPegCMExZhgVhGANYEIYxgAVhGANYEIYxgAVhGANYEIYxgAVhGANYEIYxgAVhGANKVZAuXbrAbrd7nMLDwxEVFYWGDRviL3
/5C/Lz8y3l6dGjh2EeXyYzhIWFwW63o3z58pbKq9CvX.....bytes
When I get
@RequestParam(value = "imageData") String data \\"data:image/png;base64,iVBORw0KGgoA....bytes"
I have already implementation of file upload as Multipart File to store it in file system. And is it possible to convert bytes decoded from request parametre to MultipartFile?
In you ApplicationContext.xml, you will need to add this :
Then you would require a Controller method something like this :
If you need any help, lemme know.
Also, i just read, that you want to send image, then your controller method should look like this :