Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stop Request uploading file

 
Dimiter Stoilov
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,
I have a multipart form uploading file. I want to limit the file upload to say 5mb. Everithing is fine, But with large uploads, request parse the whole input until it show my error.page for the 5mb limitation.

I tried to stop the request parsing the whole file.
Tried by redefining the request it in ServletRequestWrapper, changing its getInputStream method, throwing exceptions, calling RequestDispatcher, but no successs. Request have to parse whole file, after that it shows me whatever i told him to do.

Can you answer me is this HTTP protocol requirement or any hacks to stop the request?

Thank you for you time
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic