getting file size info

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

getting file size info

Tomaz Nolêto
Hi all,

When mozilla starts dealing with a not renderizable file using
nsExternalHelperAppService, I need to get file size info after the
Show() method is called from a nsIHelperAppLauncherDialog. Can I do it
inside Show() itself? What are the ways to do it?

Thanks in advance

--
Tomaz Nolêto
System Analyst - Embedded Linux Lab (10LE)
Instituto Nokia de Tecnologia (INdT)
[hidden email]
+55 92 2126-1115

_______________________________________________
Mozilla-netlib mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-netlib
Reply | Threaded
Open this post in threaded view
|

Re: getting file size info

Boris Zbarsky
Tomaz Nolêto wrote:
> When mozilla starts dealing with a not renderizable file using
> nsExternalHelperAppService, I need to get file size info after the
> Show() method is called from a nsIHelperAppLauncherDialog. Can I do it
> inside Show() itself? What are the ways to do it?

First problem is that we might have no idea what size the file is -- the dialog
is posed while we're still downloading the file...

-Boris
_______________________________________________
Mozilla-netlib mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-netlib
Reply | Threaded
Open this post in threaded view
|

Re: getting file size info

Tomaz Nolêto
Yes.. I realized that.. but in what moment the total file size can be
determined so? Because It is displayed before the download is done in
most of times.. isn't it? How is it done?

Boris Zbarsky wrote:

> Tomaz Nolêto wrote:
>
>> When mozilla starts dealing with a not renderizable file using
>> nsExternalHelperAppService, I need to get file size info after the
>> Show() method is called from a nsIHelperAppLauncherDialog. Can I do
>> it inside Show() itself? What are the ways to do it?
>
>
> First problem is that we might have no idea what size the file is --
> the dialog is posed while we're still downloading the file...
>
> -Boris
> _______________________________________________
> Mozilla-netlib mailing list
> [hidden email]
> http://mail.mozilla.org/listinfo/mozilla-netlib



--
Tomaz Nolêto
System Analyst - Embedded Linux Lab (10LE)
Instituto Nokia de Tecnologia (INdT)
[hidden email]
+55 92 2126-1115

_______________________________________________
Mozilla-netlib mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-netlib
Reply | Threaded
Open this post in threaded view
|

Re: getting file size info

Christian Biesinger
Tomaz Nol?to wrote:
> Yes.. I realized that.. but in what moment the total file size can be
> determined so? Because It is displayed before the download is done in
> most of times.. isn't it? How is it done?

You can QI the nsIRequest to nsIChannel, which has a contentLength
property (or a "content-length" propertybag property for 64-bit
safeness,
http://lxr.mozilla.org/seamonkey/source/netwerk/base/public/nsChannelProperties.h#46)

However, I don't think that this information is available during
show()... you should get some
nsIWebProgressListener/nsIWebProgressListener2 calls afterwards. In
fact, you can directly use the aMaxProgress argument to onProgress.

-biesi

smime.p7s (6K) Download Attachment