0

Hi everyone i have a problem. I'm trying to upload a file using a servlet. I use a embedy jetty server.

This is my servlet code:

@MultipartConfig 
public class Upload extends HttpServlet {

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    File tempDir = new File(System.getProperty("java.io.tmpdir"));
    File writeDir = new File(tempDir.toString(), "test");

    request.getPart("file").write(writeDir.toString() + "/test.dat");

}

}

But when i try to upload a file I get this error:

java.lang.IllegalStateException: No multipart config for servlet
Wundwin Born
  • 3,467
  • 19
  • 37
  • These links may help you [link1](https://bugs.eclipse.org/bugs/show_bug.cgi?id=395000) and [link2](http://stackoverflow.com/questions/18020437/no-multipartconfig-for-servlet-error-from-jetty-using-scalatra) – Wundwin Born Jul 18 '14 at 21:22
  • @ANyarThar i have already checked both links and none of them solve my problem. – esfomeado12 Jul 18 '14 at 21:30

0 Answers0