Project

General

Profile

Docs ModUploadProgress » History » Revision 6

Revision 5 (moo, 2007-07-07 15:28) → Revision 6/22 (moo, 2007-07-07 15:29)

[[TracNav(DocsToc))]] 
 [[TracNav(DocsToc))] 
 {{{ 
 #!rst 
 ======================================= 
 Uploadprogress with Lighttpd 1.5.x(svn) 
 ======================================= 

 -------------------------- 
 Module: mod_uploadprogress 
 -------------------------- 

 .. meta:: 
   :keywords: lighttpd, upload, progress 

 .. contents:: Table of Contents 

 Options 
 ======= 

 :: 

   upload-progress.progress-url     = <string> (default: /progress) 
   upload-progress.remove-timeout = <short>    (default: 60 seconds) 
   upload-progress.debug            = "(enable|disable)"    (default: "disable") 

 Description 
 =========== 

 This module can be used to track the progress of a current upload. 

 When a file upload is done, the current received bytes are tracked 
 with this module and can be retrieved via the progress-url and the 
 tracking key. This key has to be added to the upload url or via 
 header. 

 In combination with server.max-request-size, usually the browser 
 will display an error page containing information that the connection 
 has been terminated. This can not be replaced with a custom error 
 page, the browsers aren't displaying them. 

 The uploadprogress module tracks this errors now. If the upload 
 is done in one window (or an iframe which will be hidden on form submit),  
 another iframe can display a custom uploadprogress page which can  
 also fetch the status 413 via json if this happen. If 413 is retrieved, 
 a custom error message (File is too big) can be displayed. 

 The first examples can be found at  
 http://blog.lighttpd.net/articles/2006/08/01/mod_uploadprogress-is-back 

 The mentioned multi-frame example will be added in the future. 

 JSON 
 ==== 

 The returned json may contain: 

 state: 
     current state of upload 
     values = starting, error, done, uploading 

 status: 
     http error status 
     values = 413 

 size: 
     size of request 

 received: 
     bytes received by lighttpd yet 

 Example 
 ======= 

 Three html-files are appended as example, based on Jan's work mentioned 
 at the link above. You need to add the tracking_id (an example how this is 
 done with a single page upload and javascript is also provided at Jan's blog). 

 In the iframe version, you can generate the tracking_id via php or other 
 server-side scripting. 

 Warning, the files are not working out of the box, you have to change things! 


 Downloads 
 ========= 
 index.html    - main page                 
     http://trac.lighttpd.net/trac/attachment/wiki/Docs/ModUploadProgress/index.html 

 status.html - page containing progress  
     http://trac.lighttpd.net/trac/attachment/wiki/Docs/ModUploadProgress/status.html 

 upload.html - page posting the file     
     http://trac.lighttpd.net/trac/attachment/wiki/Docs/ModUploadProgress/upload.html 

 }}}