[ANN] nginx_uploadprogress_module v0.2

Brice Figureau brice+nginx at daysofwonder.com
Thu Oct 11 16:45:24 MSD 2007


On Thu, 2007-10-11 at 13:55 +0200, Otto Bretz wrote:
> Brice Figureau wrote:
> > And it is now available :-)
> > This time it should compile fine with nginx 0.6.x.
> 
> And it did! Though when I try it with the attached config I get this 
> message:
> 2007/10/11 12:05:40 [error] 1347#0: *138 open() 
> "/etc/nginx/html/progress" failed (2: No such file or directory), 
> client: my.client.tld, server: my.server.tld, URL: "/progress", host: 
> "my.server.tld", referrer: "http://my.server.tld/otto/upload.html"
> 
> To try it out I used a copy of the lighttpd upload page[1]. Is that ok? 
> I compiled the module with-debug as well and have attached the log of an 
> upload attempt.

The progress report handler doesn't yet support case-insentive progress
id parameter (I know it sucks, but that's on my todo list for v0.3).

Apply this patch to your upload.html (provided it is the same as the
file on the webpage you referenced):

--- upload.html.orig    2007-10-11 14:21:26.000000000 +0200
+++ upload.html 2007-10-11 14:21:36.000000000 +0200
@@ -40,7 +40,7 @@
     if(!req) return;
 
     req.open("GET", "/progress", 1);
-    req.setRequestHeader("X-Progress-Id", uuid);
+    req.setRequestHeader("X-Progress-ID", uuid);
     req.onreadystatechange = function () {
       if (!req) {
         window.clearTimeout(interval);


And then it will work fine.

If you are testing locally (ie the server is on the same computer or LAN
as the client), you won't see the progress bar evolving, because the
bandwidth is too high. 
If you try on a distant server with limited bandwidth it works fine, the
progress bar is slowly increasing.
If you want to see the progress evolving on localhost, I suggest you
reduce interval_msec in upload.html to something like 150 or 200,
otherwise the first /progress probe is sent after the upload has
finished :-)

To test that the upload progress works fine, I'm using curl:
To initiate the upload:
curl -v -Ffilename=@file-to-upload --limit-rate 1k "http://localhost/upload.html?X-Progress-ID=1234567890123456789019"

And to see the probe in action:
curl -v -H'X-Progress-ID: 1234567890123456789019' "http://localhost/progress"

If you want to send me debug material, please send them privately and
not on the list, that might annoy people not interested in our
discussion...

Anyway, let me know if that's working for you, and do not hesitate to
report any issues or improvements,
-- 
Brice Figureau <brice+nginx at daysofwonder.com>






More information about the nginx mailing list