GithubHelp home page GithubHelp logo

thomasbachem / apache-upload-progress-module Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drogus/apache-upload-progress-module

0.0 2.0 1.0 109 KB

Upload progress module for apache

Home Page: http://drogomir.com/blog/2008/6/18/upload-progress-bar-with-mod_passenger-and-apache

License: MIT License

Makefile 1.98% C 98.02%

apache-upload-progress-module's Introduction

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)

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

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):
  <Location />
      # enable tracking uploads in /
      TrackUploads On
  </Location>

  <Location /progress>
      # enable upload progress reports in /progress
      ReportUploads On
  </Location>

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

apache-upload-progress-module's People

Contributors

ahwatts avatar benbe avatar deadprogram avatar drogus avatar mpokrywka avatar nicfloss avatar simplecircle avatar

Watchers

 avatar  avatar

Forkers

intellum

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.