XMLHttpRequest progressive download?

Posted by StackedCrooked on Stack Overflow See other posts from Stack Overflow or by StackedCrooked
Published on 2010-05-05T22:25:57Z Indexed on 2010/05/05 22:38 UTC
Read the original article Hit count: 192

Filed under:
|

Just for fun I was creating a JavaScript console for controlling my PC. It involves a small webserver that takes command strings and forwards those to the system using popen calls (to be more specific popen4 on a Ruby mongrel server). The stdout channels are redirected to the http response.

The problem is that the response only arrives once the entire contents of stdout has been sent. This is ok for small commands, but not for a command like find / which lists all the files in the system. In such situations it would be nice to have the results shown progressively in the webview (just like in the regular terminal).

I thought that using XMLHttpRequest synchronously might result in progressive downloading, but it doesn't seem so.

Is there any way to make it work?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about AJAX