Skip to content


Subversion checkout URL

You can clone with
Download ZIP
The new infusion uploader demo to replace the old image gallery.
Tree: 3b04f8438f

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


How to install:
Place the image-gallery folder at your web server document root, access via (just an example):

How it looks like:
This image gallery uploader demo is composed by 2 parts: the multi-file uploader at left and an viewer at right. 

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

2. Once the PHP server receives the uploaded image, it places the image into a temp folder that is named by the session token from the client, then sends back the message which is the url to the uploaded image, the client retrives the url and adds it to the viewer. 

3. if anything goes wrong at PHP server, for instance, no file is received, session token is not provided, etc, the server returns a error message with http status code 400, the client displays the error on the interface along with the name of the corresponding file that is uploaded.

A few restrictions performed at PHP server:
1. The server removes all the temporary folders that stay inactive for one hour. This is performed in uploader.php as the first thing whenever it's called.

2. For security reason, only allow the upload of these file type: jpg, gif, png, tif

3. When the file with the same name is uploaded twice, append a unique incremental number to the file name.
   for instance, "1.jpg" is renamed to "1-1.jpg" at the second upload.
1. in uploader.html, line 37, "styles.css" is linked in at "the uploader demo" section, should it be moved to the top of the script to be together with other .css
Something went wrong with that request. Please try again.