Re: How can you make an async http request to download a file in chunks?



The example looks good,

http://www.roojs.org/seed/gir-1.2-gtk-3.0/gjs/Soup.Message.html#expand

indicates there is a got_chunk signal of message, you might be able to hook into that to update the progress bar.

you might be lucky and be able to get the header  Content-Length,  and use the length of the response_body to show the percentage complete..., but Soap is a touch klunky when it comes to introspection..

I'm not sure about gjs, but handling of non-utf8 characters in seed can seriously mess up the engine, so be careful..

Regards
Alan

On Monday, February 11, 2013 02:29 PM, Micah Lee wrote:
I just asked this question on stackoverflow, but hopefully somewhere
here could help too:

http://stackoverflow.com/questions/14806981/using-gjs-how-can-you-make-an-async-http-request-to-download-a-file-in-chunks

Basically, I'm trying to download a file and show the status of the
download in a Gtk.ProgressBar. Any help or example code is appreciated,
thanks!



_______________________________________________
_javascript_-list mailing list
_javascript_-list gnome org
https://mail.gnome.org/mailman/listinfo/_javascript_-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]