Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Limit File Size or Request Size

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Limit File Size or Request Size

    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.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Limit File Size or Request Size

    Please post link to other posts of this problem.

  3. #3
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Limit File Size or Request Size

    If your application is client side, you can use the File class and call the length() method to get it's size in bytes. Then all you would have to do is compare the value it gives back with an upper limit.

  4. #4
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Limit File Size or Request Size

    This is a duplicate thread of http://www.javaprogrammingforums.com...uest-size.html

    Locking!

    // Json

Similar Threads

  1. Limit File Size or Request Size
    By tarek.mostafa in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: June 11th, 2010, 07:21 AM
  2. Font Size
    By nasi in forum AWT / Java Swing
    Replies: 5
    Last Post: May 13th, 2010, 06:22 AM
  3. [SOLVED] Hashtable and Key Size
    By sapzero in forum Collections and Generics
    Replies: 0
    Last Post: January 28th, 2010, 02:31 PM
  4. How to set the Listbox size.
    By jacinto in forum AWT / Java Swing
    Replies: 4
    Last Post: June 22nd, 2009, 07:39 AM
  5. How to Get the size of a file in bytes
    By JavaPF in forum File Input/Output Tutorials
    Replies: 1
    Last Post: June 8th, 2009, 10:19 AM