GitXplorerGitXplorer
d

apache-upload-progress-module

public
152 stars
25 forks
4 issues

Commits

List of commits on branch master.
Unverified
c9d554e7bac5abd8d5880d55528aee55fac412d4

Merge pull request #21 from BenBE/master

BBenBE committed 14 years ago
Unverified
dff9a0339d4553fa32b8e58a997c313672a1ee84

mrg: Merged changes from drogus/master

BBenBE committed 14 years ago
Unverified
a931bebb1a78ab02f40afb3cc902c0d99f96f350

Merge pull request #24 from mpokrywka/master

BBenBE committed 14 years ago
Unverified
c7b11f52a9e17c421a368a909373e29d4e43665b

Merge pull request #27 from dallarosa/master.

ddrogus committed 14 years ago
Unverified
cfe02f1b6b059fd15f2c28d13dc938908e3a2a81

changed the content-type from text/javascript to application/json

committed 14 years ago
Unverified
6e7b62d5702250e21804f64f73ddab4b300afe96

Move cache data writing to separate function

mmpokrywka committed 14 years ago

README

The README file for this repository.

Apache upload progress module. Works with mod_passenger (aka mod_rails). It's MIT license.

More info here: http://drogomir.com/blog/2008/6/18/upload-progress-bar-with-mod_passenger-and-apache

Tutorials showing how to use apache upload progress module: http://www.drogomir.com/blog/2008/7/3/tweaking-rails-app-with-jquery-part-i (using jQuery) http://www.railsillustrated.com/screencast-file-uploads-progress-in-rails-passenger.html (tutorial with screencast using prototype)

To install and activate module: apxs2 -c -i -a mod_upload_progress.c

-c -> compile -i -> install (copy upload_progress_module.so to apache lib folder) -a -> activate (add LoadModule line to httpd.conf)

On Macs: apxs -c -i -a -Wc,"-arch i386 -arch x86_64" -Wl,"-arch i386 -arch x86_64" mod_upload_progress.c

Missing compiler directory:

If you get this error:
  /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.11.xctoolchain/usr/bin/cc: No such file or directory
create a symlink before compiling:
  sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.11.xctoolchain

OS X 10.11 El Capitan with System Integrity Protection (SIP):

You will get this error when installing:
  install: /usr/libexec/apache2/mod_upload_progress.so: Operation not permitted
You can work around that by creating a custom directory and copy the file over after compiling:
  mkdir /usr/local/libexec/apache2
  cp .libs/mod_upload_progress.so /usr/local/libexec/apache2/mod_upload_progress.so
You can then manually reference this location in your httpd.conf file:
  LoadModule upload_progress_module /usr/local/libexec/apache2/mod_upload_progress.so

Global config: you can define maximum size for shared memory (default is 50kB): UploadProgressSharedMemorySize 1024000 # sets memory size to 1MB

Note: 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): # 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: http://uploads.yourdomain.com/progress?callback=jsonp123&X-Progress-ID=12345678

    Would return the JSON-P function: jsonp123({ "state" : "uploading", "received" : 35587, "size" : 716595, "speed" : 35587, "started_at": 1296568823, "uuid" : "12345678" });

    The normal JSON request: http://www.yourdomain.com/progress?X-Progress-ID=12345678

    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 ._$