Skip to content
The new infusion uploader demo to replace the old image gallery.
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


How to install:
1. First of all, make sure you have PHP, Apache (or other web servers) and git installed. Moreover, infusion library is pulled out locally.

2. Retrieve image gallery demo and install:
   cd [webserver_document_root]         -- or any folder underneath your web server document root
   git clone git://
   cd image-gallery
   dos2unix     -- convert the installation script in DOS/MAC format to UNIX format
   ./            -- asks for the path to your local infusion library

3. That's all. Now access via (just an example): http://localhost/image-gallery/uploader.html

How it looks like:
This image gallery uploader demo is composed by 2 parts: the uploader at left and an image viewer at right. The uploader can be a single-file uploader when the flash is not installed (IE) or the javascript is disabled, otherwise the multi-file uploader.

The work flow:
1. When "upload" button is clicked: the html page sends the upload request to the server along with a session token. This session token is a unique 13-character string that is generated by front-end javascript. It helps the php server to distinguish the upload requests from different clients. 

2. Once the PHP server receives the uploaded image, it looks up in the "temp" directory for the sub-directory that is named after the sent-in session token. If the sub-directory does not exist, creates a new. The uploaded images are placed into the sub-directory, then the server sends back the url of the uploaded image. The client retrives the url and adds it to the image viewer. 

3. If anything goes wrong at PHP server, for instance, no file is received, session token is not provided, invalid file extension, or temp/ folder does not exist, the server returns a error message with http status code 400. The client displays the error on the page along with the name of the corresponding file.

A few constraints performed at PHP server:
1. Removes the temporary folder created for each session that are inactive for over an hour. This is performed in uploader.php as the first thing whenever it's called.

2. For security reason, the server only allows the upload of these file types: jpg, jpeg, gif, png, tif, tiff

3. Rejects the same file that has already been uploaded.
Something went wrong with that request. Please try again.