Failed convert from multipartFile to Blob
<p>I want to save document to MySQL database.</p>

<p>I have following controller</p>

<pre><code> @RequestMapping(value = "/save", method = RequestMethod.POST)
    public String save(
            @ModelAttribute("document") @Valid Document document,
            BindingResult bindingResult,
            @RequestParam("content") MultipartFile file) {
</code></pre>

<p>and form:</p>

<pre><code>&lt;form th:action="@{/save}" th:object="${document}"  method="post" enctype="multipart/form-data"&gt;

        &lt;h4&gt;Nazwa&lt;/h4&gt;
        &lt;input type="text" th:field="*{name}"/&gt;
        &lt;td style="color:red" th:if="${#fields.hasErrors('name')}" th:errors="*{name}"&gt;&lt;/td&gt;

        &lt;h4&gt;Opis&lt;/h4&gt;
        &lt;input type="text" th:field="*{description}"/&gt;
        &lt;td style="color:red" th:if="${#fields.hasErrors('description')}" th:errors="*{description}"&gt;&lt;/td&gt;

        &lt;h4&gt;zawartosc&lt;/h4&gt;
        &lt;input type="file" th:field="*{content}"/&gt;
        &lt;td style="color:red" th:if="${#fields.hasErrors('content')}" th:errors="*{content}"&gt;&lt;/td&gt;
</code></pre>

<p>and I don't have idea how to fix this error:</p>

<blockquote>
  <p>Failed to convert property value of type
  org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile
  to required type java.sql.Blob for property content; nested exception
  is java.lang.IllegalStateException: Cannot convert value of type
  [org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile]
  to required type [java.sql.Blob] for property content: no matching
  editors or conversion strategy found</p>
</blockquote>