views:

655

answers:

6

Hi, I'm implementing ubr upload. It used Perl and PHP to upload files with a progress bar. I'm running a lighttpd development server and would like to test it fully. Currently it just transfer the files instantly since its really just moving files on my computer. Is there a way to make it seem like it actually transfers it slowly so I can watch the progress bar?

I tried adding the following to my lighttpd.conf. It may have slowed down loading the pages a little, but uploads are still instantanteous.

$HTTP["host"] == "localhost" {
        server.kbytes-per-second = 8
}

Thanks

A: 

Instead of throttling things on the server side, you could try throttling your client machine. There's a nice article on how to throttle bandwidth on macs over at O'Reilly:

ipfw is a BSD thing, but on Linux you could try using the shaper module and shapecfg:

tgamblin
A: 

$HTTP['host'] contains the host of the server. You could put the config variable in the configuration file without the host check.

Peter Stuifzand
A: 

Thanks for the help! Actually, I'm dual booting and just tested my exact script on my apache server. When I transfer a 200mb file on apache it actually displays the progress bar as the file transfers. On my lighttpd server, the page is "busy" as it posts the file in the background, then the bar pops up as 100% complete.

I think the way the script works is that CGI posts the file, and as it is doing that it keeps writing the size it has written into another file. Then a php script is being called every second which opens this file and looks at how much has been written.

It seems like my lighttpd server is not allowing perl and php to work at the same time.. I may be wrong though.

On my windows server I actually installed WAMP and perl. My lighttpd is using fastcgi for the php and just mod_cgi module for the perl scripts.

A: 

Ah it looks like other people have issues with lighttpd and uber uploader...

(can't link to it since I'm new)

Now the question is if lighttpd is worth using since I'll have to change this on top of all my mod_rewrite stuff.

A: 

Try using charles: http://www.charlesproxy.com/

Evert
A: 

You can limit your browser bandwidth by using the Sloppy HTTP proxy: http://www.dallaway.com/sloppy/

Sloppy deliberately slows the transfer of data between client and server.

Example usage: you probably build web sites on your local network, which is fast. Using Sloppy is one way to get the "dial-up experience" of your work without the hassle of having to install a modem.

MiKy