Skip to content
Browse files

Modified README

  • Loading branch information...
1 parent 8b5c18c commit 10955b63d51d89500bb8db97658ea845bc69dbf4 Cindy Li committed Mar 22, 2011
Showing with 12 additions and 7 deletions.
  1. +12 −7 README
View
19 README
@@ -1,11 +1,16 @@
How to install:
-1. First of all, make sure PHP web server is installed;
+1. First of all, make sure PHP web server and git are installed. Moreover, infusion source code is pulled out locally.
-2. Place the "image-gallery" folder at PHP web server document root;
+2. Retrieve image gallery demo into :
+ cd [webserver_document_root] -- or any folder underneath your web server document root
+ git clone git://github.com/cindyli/image-gallery.git
3. Create an empty folder "temp" underneath "image-gallery" and grant it 777 permissoin. This is where all the uploaded images will reside.
+ cd image-gallery
+ mkdir temp
+ chmod 777 temp
-4. The scripts, lines that need to be modified with the right path to infusion source code.
+4. Modified the path in the listed scripts pointing to your infusion source code.
uploader.html - line 7 - 34
js/uploader.js - line 12, 21, 22
@@ -15,14 +20,14 @@ How it looks like:
This image gallery uploader demo is composed by 2 parts: the multi-file uploader at left and an image viewer at right.
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 javascript. It helps the php server to distinguish the upload requests from different clients.
+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, the script creates it. 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.
+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, etc, 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.
+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. The server removes the temporary folders that are inactive for one hour. This is performed in uploader.php as the first thing whenever it's called.
+1. The server 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

0 comments on commit 10955b6

Please sign in to comment.
Something went wrong with that request. Please try again.