title: File(resume) upload using spring-mvc
body: <p>I am uploading a file (a Microsoft office word document) using spring mvc.<br>
  For that I am using spring <code>org.springframework.web.multipart.MultipartFile</code>.<br>
  I'm able to upload the file but facing problems in storing it in a MySQL database.<br>
  When I save the file as multipartFile obtained from the form submission (<code>MultipartFile multipartFile = employee.getFile();</code>). It's saved in the database as object named as</p>
  
  <blockquote>
    <p>org.springframework.web.multipart.commons.CommonsMultipartFile@1c79dfc.</p>
  </blockquote>
  
  <p>I want to store the data as string (present in the file). How do I convert multipartFile in string format such that I can save it in a MySQL database using type TEXT.</p>
  
  <p>Here's the info on multipartFile:</p>
  
  <pre><code>MultipartFile multipartFile = employee.getFile();
  byte[] content=multipartFile.getBytes();
  String s = new String(content);
  log.info ("size:"+multipartFile.getSize());
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>size:10066</p>
  </blockquote>
  
  <pre><code>log.info ("content type:"+multipartFile.getContentType());
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>content
    type:application/vnd.openxmlformats-officedocument.wordprocessingml.document</p>
  </blockquote>
  
  <pre><code>log.info("Filename:"+multipartFile.getOriginalFilename());
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>Filename:prabhat-resume.docx</p>
  </blockquote>
  
  <p>I want to save it in the database as a TEXT blob. What do I need to do?</p>