title: single and multiple File upload using jquery ajax in Struts 2
body: <p>how to upload a file using ajax jquery with showing progress bar while uploading in struts2 i searched every where no luck can any one give me idea or some code snipplet thank you.for now i am using normal upload in html like this.</p>
  
  <pre><code>&lt;a id="addFile-link" href="#" title="add file"&gt;&lt;img src="htdocs/images/add_file.png" style="width: 20px; height: 20px; border: 0"&gt;&lt;/a&gt; 
                   &lt;form id="form" name="form" target="viewFileUpload" method="post"
                  action="fileUpload.do" enctype="multipart/form-data"&gt;
                  &lt;input type="file" name="upload" id="file" class="fileUpload" multiple&gt;
  
                   &lt;/form&gt;
  
  
    $("#addFile-link").click(function() {
  var initialFolderId = document.getElementById('currentFolder').value;
              //Added for converting first time page load null or empty value validation in Servelet engine
              if (initialFolderId == null || initialFolderId == "") {
                  initialFolderId = 0;
              }
  
              document.getElementById('selectedFolder').value = initialFolderId;
              $("#file").click();
              var uploadElement = document.getElementById("file");
              $('#file').change(function() {
  
                  uploadElement.form.submit();
  
                  //sleep(100)
                  setTimeout(function() {openFolder(document.getElementById('currentFolder').value);getRecentActivity(0);}, 3000);
                  $('#Activites').html(""); 
  
              });
          });
  </code></pre>