public
Description: Upload progress bar working with apache, nginx and lighttpd upload progress modules
Clone URL: git://github.com/drogus/jquery-upload-progress.git
name age message
file .project Fri Jun 27 06:08:44 -0700 2008 Initial commit [drogus]
file README Tue Jul 01 16:36:34 -0700 2008 Added README [drogus]
directory example/ Mon Jun 30 04:19:56 -0700 2008 options.jqueryPath and options.uploadProgressPa... [drogus]
file jquery.uploadProgress.js Wed Jul 02 10:42:40 -0700 2008 Preloading images if needed. It's mainly for sa... [drogus]
directory lib/ Fri Jun 27 06:08:44 -0700 2008 Initial commit [drogus]
README
Usage:

some html:
     <form id="upload" enctype="multipart/form-data" action="index.html" method="post">
        <input name="file" type="file"/>
        <input type="submit" value="Upload"/>
      </form>
    
      <div id="uploading">
        <div id="progress" class="bar">
          <div id="progressbar">&nbsp;</div>
          <div id="percents"></div>
        </div>
      </div>

then some css:
  
  .bar {
    width: 300px;
  }
  
  #progress {
    background: #eee;
    border: 1px solid #222;
    margin-top: 20px;
  }
  #progressbar {
    width: 0px;
    height: 24px;
    background: #333;
  }

and a bit of javascript:

$(function() {
    $('form').uploadProgress({
    /* scripts locations for safari */
    jqueryPath: "../lib/jquery.js",
    uploadProgressPath: "../jquery.uploadProgress.js",
                /* function called each time bar is updated */
    uploading: function(upload) {$('#percents').html(upload.percents+'%');},
    /* selector or element that will be updated */
    progressBar: "#progressbar",
    /* progress reports url */
    progressUrl: "/progress",
                /* how often will bar be updated */
    interval: 2000
    });
});


defaults:

interval: 2000
progressBar: "#progressbar"
progressUrl: "/progress"
start: function() {}
uploading: function() {}
complete: function() {}
success: function() {}
error: function() {}
uploadProgressPath: '/javascripts/jquery.js'
jqueryPath: '/javascripts/jquery.uploadProgress.js'