0

can't read the Part :

my code :

Part filePart = request.getPart("PdfFile");



out.print(filePart.getSize()+"");

the error :

Unable to process parts as no multi-part configuration has been provided

Rami Osman
  • 137
  • 1
  • 13

2 Answers2

-1

I recommend using Apache Commons Fileupload: http://commons.apache.org/proper/commons-fileupload/

Simon Martinelli
  • 34,053
  • 5
  • 48
  • 82
  • This is unnecessary since 2009. Moreover, the question already shows new approach. Please catch up. – BalusC Feb 27 '16 at 17:23
-1

Define a multipart resolver like this in your context file

<beans:bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
    <beans:property name="maxUploadSize" value="10000000" />
</beans:bean>
PyThon
  • 1,007
  • 9
  • 22
  • Nothing in the question indicates OP is using Spring. Recommending to install a whole 3rd party framework just because the OP couldn't figure out how to use a standard API method makes no utter sense. – BalusC Feb 27 '16 at 17:24