title: JSP File upload limit size
body: <p>Below are my upload photo code. How to limit the photo size? Does jquery has this function? I google search already can't find any, but said can't find the file size on client side?</p>
  
  <pre><code>   $().ready(function() {
              // validate signup form on keyup and submit
              $("#new_product").validate({
                  rules: {
                      item_picture: {
                          required: true,
                          accept: "jpg|gif|png"
                      }
                  },
                  messages: {
                      item_picture: {
                          required:"Please choose an item picture",
                          accept:"File type was invalid"
                      }
                  },
                  errorElement: "div" //
              });
          });
  
     &lt;form action="create_auction_item" enctype="multipart/form-data" class="new_product" id="new_product" method="post" style=" padding: 20px;"&gt;
   ......
  
   &lt;tr&gt;
       &lt;th&gt;
           &lt;label for="picture"&gt;Item Picture&lt;span style="color:red;"&gt;*&lt;/span&gt;&lt;/label&gt;
       &lt;/th&gt;
       &lt;td&gt;
           &lt;input  id="item_picture" name="item_picture" size="30" type="file" accept="gif|jpeg|bmp|png|jpg"/&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
  
   &lt;/form&gt;
  </code></pre>