Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Limit File Size or Request Size

 
Tarek Mostafa
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,



I developed a web application and it is working fine, except for one issue. The application includes uploading files from a JSP to my servlet, and the issue is that i would like to have a limit for the uploaded files on the client side (before actually uploading it).



I investigated alot and found some ways like changing my JSPs to PHPs, which is not feasable for my application. I would also like to add that using the Flash component ("<object>") for uploading is not feasable also at this time. Using ActiveX does not work also (for some security issues in javascript, it can not access the system information, also ActiveX works only on IE).



I would like to add that I have my application running on Oracle application Server, JSPs for displaying the forms, MultiPart Java API for getting the form input values and files to my servlet and everything is developed in JAVA.



I would like some help to solve this problem, either by limiting the file size or the limiting the whole request size sent to the servlet.



Thanks in advance and I really appreciate your help.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only thing you haven't eliminated is applets; that's the only other (trivial) way to get the size of the file before an upload begins. The other option is to stop the upload as soon as the maximum size is exceeded, which could be done doing some sort of upload listener--the specifics would depend on what you're actually using.
 
Tarek Mostafa
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David Newton for the reply,

I will consider the solution, although i doubt that i will be able to change my whole application to applets.

Thanks anyway and i appreciate any more suggestions, if any left.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!