Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 0.2
Fetching contributors…

Cannot retrieve contributors at this time

63 lines (46 sloc) 2.722 kb
Apache upload progress module. Works with mod_passenger (aka mod_rails). It's MIT license.
More info here:
Tutorials showing how to use apache upload progress module: (using jQuery) (tutorial with screencast using prototype)
To install and activate module:
apxs2 -c -i -a mod_upload_progress.c
-c -> compile
-i -> install (copy to apache lib folder)
-a -> activate (add LoadModule line to httpd.conf)
To compile it on mac you may need to:
sudo apxs -c -i -Wc,-arch -Wc,ppc7400 -Wl,-arch -Wl,ppc7400 -Wc,-arch -Wc,ppc64 -Wl,-arch -Wl,ppc64 -Wc,-arch -Wc,x86_64 -Wl,-arch -Wl,x86_64 -Wc,-arch -Wc,i386 -Wl,-arch -Wl,i386 mod_upload_progress.c
Global config:
you can define maximum size for shared memory (default is 50kB):
UploadProgressSharedMemorySize 1024000 # sets memory size to 1MB
If you get "(12)Cannot allocate memory: Upload Progress cache: could not create shared memory segment Configuration Failed"
error you should try to set memory size to smaller value.
Config for vhost (or global locations):
<Location />
# enable tracking uploads in /
TrackUploads On
<Location /progress>
# enable upload progress reports in /progress
ReportUploads On
- Valid progress ID
Progress IDs are now validated: length must be within 8..128 characters,
identifier may contain alphanumeric characters and also -_:./!{}
- JSON-P Support
You can also request progress updates by using JSON-P, if you are uploading
the file from a different domain or subdomain than the web server that is
handling your original request. Adding a "callback=yourCallbackFunction"
parameter to your request to the progress server will activate this functionality.
For example, a request like:
Would return the JSON-P function:
jsonp123({ "state" : "uploading", "received" : 35587, "size" : 716595, "speed" : 35587, "started_at": 1296568823, "uuid" : "12345678" });
The normal JSON request:
Would return the JSON data:
{ "state" : "uploading", "received" : 35587, "size" : 716595, "speed" : 35587, "started_at": 1296568823, "uuid" : "12345678" }
- Valid JSON-P callbacks
Callback names are now validated: length must be within 1..64 characters
identifier may contain alphanumeric characters and also ._$
Jump to Line
Something went wrong with that request. Please try again.