Nginx upload module



NOTE: This version of module is deprecated. Use new version of this module.



A module for nginx to upload files via multipart/form-data encoding (RFC 1867).

Description

The module parses request body storing all uploaded files to specified directory. After successful completion redirects to an URL specified by upload_successful_redirect_url configuration option.

Directives


syntax: upload_enabled [0|1]
default: 0
context: location

Activates the module (the value should be greater than zero).


syntax: upload_store_location <directory>
default: none
context: location

Specifies a directory to which uploaded files will be stores.


syntax: upload_successful_redirect_url <URL>
default: none
context: location

Specifies absolute or relative URL, to which redirect will be made after successful completion.


Download

Latest version 1.0.3: nginx-0.5.12-upload-patch-1.0.3.gz
Version 1.0.2: nginx-0.3.57-upload-patch-1.0.2.gz
Version 1.0.1: nginx-0.3.57-upload-patch-1.0.1.gz
Version 1.0.0: nginx-0.3.49-upload-patch-1.0.0.gz

How to use

To apply patch: place it to a directory, where nginx sources are located.
Unpack the patch via command:

gzip -d nginx-0.5.12-upload-patch-1.0.3.gz
        

Apply patch using command:

patch -p 0 -d . < nginx-0.5.12-upload-patch-1.0.3
        

How to configure nginx:
To activate upload module pass --with-http_upload_module option to ./configure script:

./configure --with-http_upload_module
        

To activate: place following lines into nginx configuration file:

location /upload {
    upload_enabled 1; # Module activation
    upload_store_location /tmp; # Path where files will be stored
    upload_successful_redirect_url /successful.html # Absolute or relative URL, to which redirect after successful completion will be performed

    error_page 500 /failed.html # URI, which will be shown after failure
}
        

Compatibility

Version 1.0.3 is compatible with stable version 0.5.12 of nginx.

Nginx

nginx -- is a web-server, developed by Igor Sysoev.

Licence

The above-described module is an addition to nginx web-server, nevertheless they are independent products. The licence of above-described module is BSD

Contact author

Valery Kholodkov valery@grid.net.ru