Skip to content

Commit 14a66c4

Browse files
rootBrice Figureau
authored andcommitted
Adding instructions for jQuery AJAX compatablity, change the JSON template example to double quoted properties, and fixed a few minor spelling errors.
1 parent b950e60 commit 14a66c4

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

README

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ track_uploads
7777
The POST _must_ have a query parameter called X-Progress-ID (or an HTTP header of the same name) whose value is the
7878
unique identifier used to get progress information. If the POST has no such information, the upload will not be tracked.
7979
The tracked connections are kept at most <timeout> seconds after they have been finished to be able to serve
80-
unseful information to upload progress probes.
80+
useful information to upload progress probes.
8181
WARNING: this directive must be the last directive of the location. It must be in a proxy_pass or
8282
fastcgi_pass location.
8383

@@ -107,7 +107,7 @@ report_uploads
107107
upload_progress_template
108108

109109
The HTTP request to this location must have a X-Progress-ID parameter or HTTP header containing a valid
110-
unique identifier of an inprogress upload.
110+
unique identifier of an in progress upload.
111111

112112
upload_progress_content_type
113113
++++++++++++++++++++++++++++
@@ -133,6 +133,14 @@ upload_progress_jsonp_parameter
133133
:Description:
134134
This directive allows to change the name of the GET parameter with the jsonp callback name.
135135

136+
upload_progress_java_output
137+
+++++++++++++++++++++++++++
138+
:Syntax: upload_progress_java_output
139+
:Default: N/A
140+
:Context: location
141+
:Description:
142+
This directive sets everything to output as eval() javascript compatible code.
143+
136144
upload_progress_json_output
137145
+++++++++++++++++++++++++++
138146
:Syntax: upload_progress_json_output
@@ -179,10 +187,10 @@ upload_progress_template
179187

180188
Example of jsonp response:
181189

182-
upload_progress_template starting "$uploadprogress_callback({ 'state' : 'starting'});";
183-
upload_progress_template error "$uploadprogress_callback({ 'state' : 'error', 'status' : $uploadprogress_status });";
184-
upload_progress_template done "$uploadprogress_callback({ 'state' : 'done'});";
185-
upload_progress_template uploading "$uploadprogress_callback({ 'state' : 'uploading', 'received' : $uploadprogress_received, 'size' : $uploadprogress_length });";
190+
upload_progress_template starting "$uploadprogress_callback({ \"state\" : \"starting\"});";
191+
upload_progress_template error "$uploadprogress_callback({ \"state\" : \"error\", \"status\" : $uploadprogress_status });";
192+
upload_progress_template done "$uploadprogress_callback({ \"state\" : \"done\"});";
193+
upload_progress_template uploading "$uploadprogress_callback({ \"state\" : \"uploading\", \"received\" : $uploadprogress_received, \"size\" : $uploadprogress_length });";
186194

187195
Configuration Example:
188196
+++++++++++++++++++++
@@ -302,3 +310,10 @@ http://www.grid.net.ru/nginx/upload.en.html
302310
You can also use the following javascript libraries client side:
303311
http://drogomir.com/blog/2008/6/30/upload-progress-script-with-safari-support
304312

313+
Note that when using jQuery AJAX for progress monitoring, such as:
314+
https://github.com/drogus/jquery-upload-progress
315+
you should be sure to set a upload_progress template parameter:
316+
upload_progress_json_output
317+
or
318+
upload_progress_jsonp_output
319+
depending on your jQuery AJAX dataType setting.

0 commit comments

Comments
 (0)