Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>org.springframework.web.multipart.MultipartFile is an interface so firstly you are going to need to work with an implementation of this interface.</p> <p>The only implementation that I can see for that interface that you can use out-of-the-box is org.springframework.web.multipart.commons.CommonsMultipartFile. The API for that implementation can be found <a href="http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/web/multipart/commons/CommonsMultipartFile.html" rel="noreferrer">here</a></p> <p>Alternatively as org.springframework.web.multipart.MultipartFile is an interface, you could provide your own implementation and simply wrap your byte array. As a trivial example:</p> <pre><code>/* *&lt;p&gt; * Trivial implementation of the {@link MultipartFile} interface to wrap a byte[] decoded * from a BASE64 encoded String *&lt;/p&gt; */ public class BASE64DecodedMultipartFile implements MultipartFile { private final byte[] imgContent; public BASE64DecodedMultipartFile(byte[] imgContent) { this.imgContent = imgContent; } @Override public String getName() { // TODO - implementation depends on your requirements return null; } @Override public String getOriginalFilename() { // TODO - implementation depends on your requirements return null; } @Override public String getContentType() { // TODO - implementation depends on your requirements return null; } @Override public boolean isEmpty() { return imgContent == null || imgContent.length == 0; } @Override public long getSize() { return imgContent.length; } @Override public byte[] getBytes() throws IOException { return imgContent; } @Override public InputStream getInputStream() throws IOException { return new ByteArrayInputStream(imgContent); } @Override public void transferTo(File dest) throws IOException, IllegalStateException { new FileOutputStream(dest).write(imgContent); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload