Dropwizard file upload

后端 未结 3 1000
野的像风
野的像风 2021-02-01 18:36

I have to upload a file from my site yet cnt seem to get it working with drop wizard.

Here is the form from my site.

   
3条回答
  •  星月不相逢
    2021-02-01 19:29

    You could do the saving to the server in lesser number of lines using nio

    java.nio.file.Path outputPath = FileSystems.getDefault().getPath(, fileName);
    Files.copy(fileInputStream, outputPath);
    

    Also, if you're using 0.7.0-rc2, you will need this dependency in your pom.xml

    
    com.sun.jersey.contribs
    jersey-multipart
    1.18
    
    

提交回复
热议问题