GeckoFX

Skybound

Skybound Software is looking to hire experienced C# developers to work on Stylizer and other forthcoming Skybound products. Click here for details.

GeckoFX is an open-source component which makes it easy to embed Mozilla Gecko (Firefox) into any .NET Windows Forms application. Written in clean, fully commented C#, GeckoFX is the perfect replacement for the default Internet Explorer-based WebBrowser control. Download GeckoFX @ Google Code >

GeckoFX is made by Skybound Software, authors of Stylizer—the professional CSS editor with a strong focus on visual control, error-free workflow, and productivity. Learn About Stylizer >

GeckoFX Forum

Discuss GeckoFX, the Open-Source Gecko Control for .NET

You are not logged in.

Download file ?

#1 June 12, 2008 10:50 PM

newcomer11
Member
Registered: May 04, 2008
Posts: 22

Download file ?

GeckoFX 1.8.1.4 display error when download file, so how to download file?

How to "catch" the download event - that provide the file information (Response.ContentCharset, Response.ContentLength ...) before actually download it ? ( Not in the Navigated event) - to write my own download function ? I can check the URL string like : "http://live.com/a.zip" to download file, but what about URL like this : "http://live.com/download.php?file_id=2" that link to a file ?

Thank you for you advise.

Offline

 

#2 June 14, 2008 4:27 PM

Panda X
Member
Registered: June 14, 2008
Posts: 10

Re: Download file ?

I would like to know this aswell.

Offline

 

#3 June 16, 2008 6:37 AM

Skybound_Andrew
Administrator
From: Fenwick, Ontario, Canada
Registered: February 05, 2008
Posts: 380
Website

Re: Download file ?

You need to modify the source to catch this event.

on line 1598 in the nsIWebProgressListener.OnStateChange method, add this code:

Code:

if ((aStateFlags & nsIWebProgressListenerConstants.STATE_TRANSFERRING) != 0)
{
    GeckoResponse rsp = new GeckoResponse(aRequest);
    if (rsp.ContentType == "application/x-executable")
    {
        // do something
    }
}

There's also some information at http://developer.mozilla.org/en/docs/XU … ad_dialogs about implementing download dialogs but I haven't actually tried it.

Offline

 

#4 June 16, 2008 9:42 PM

newcomer11
Member
Registered: May 04, 2008
Posts: 22

Re: Download file ?

Wow, thank you for you tips, I wish that this feature will be implement in next version :)

Offline

 

#5 June 23, 2008 7:02 AM

drezaem
Member
From: France
Registered: June 23, 2008
Posts: 13

Re: Download file ?

Hi,

I actually use your fantastic GeckoFX and i always get an error message when i try to download a file (whatever the type).

"C:DOCUME~1userLOCALS~1tempfile.zip could not be saved, because the source file could not be read.

Try again later or contact the server administrator"

Can someone help me please ?

(I hope my english is comprehensible)

Thx for your answers !

Offline

 

#6 June 26, 2008 9:18 PM

Panda X
Member
Registered: June 14, 2008
Posts: 10

Re: Download file ?

drezaem wrote:


Hi,

I actually use your fantastic GeckoFX and i always get an error message when i try to download a file (whatever the type).

"C:DOCUME~1userLOCALS~1tempfile.zip could not be saved, because the source file could not be read.

Try again later or contact the server administrator"

Can someone help me please ?

(I hope my english is comprehensible)

Thx for your answers !

I too get this error.

Offline

 

#7 June 26, 2008 9:25 PM

Skybound_Andrew
Administrator
From: Fenwick, Ontario, Canada
Registered: February 05, 2008
Posts: 380
Website

Re: Download file ?

The download manager is not working yet.

Offline

 

#8 June 26, 2008 10:58 PM

Skybound_Andrew
Administrator
From: Fenwick, Ontario, Canada
Registered: February 05, 2008
Posts: 380
Website

Re: Download file ?

I just fixed the download manager.  Downloads will be working in the next release.

Offline

 

#9 June 30, 2008 5:27 AM

drezaem
Member
From: France
Registered: June 23, 2008
Posts: 13

Re: Download file ?

Hi,

Thx for your GREAT job !

Waiting for th next release ;)

Offline

 

#10 July 02, 2008 8:32 AM

drezaem
Member
From: France
Registered: June 23, 2008
Posts: 13

Re: Download file ?

Hi Andrew,

Can you tell me when you think the next release wil be available ?

If it's possible, can you post the code added for the downloads ?

Thank you for your answer.

Offline

 

#11 July 02, 2008 8:37 AM

Skybound_Andrew
Administrator
From: Fenwick, Ontario, Canada
Registered: February 05, 2008
Posts: 380
Website

Re: Download file ?

I'll try and get it posted within the next few days.

Offline

 

#12 February 05, 2010 4:47 PM

AETCoder
Member
Registered: February 05, 2010
Posts: 6

Re: Download file ?

Which file do you post the code into to, is it GeckoWebbrowser.cs?

Offline

 

#13 February 08, 2010 11:06 AM

AETCoder
Member
Registered: February 05, 2010
Posts: 6

Re: Download file ?

Skybound_Andrew wrote:

You need to modify the source to catch this event.

on line 1598 in the nsIWebProgressListener.OnStateChange method, add this code:

Code:

if ((aStateFlags & nsIWebProgressListenerConstants.STATE_TRANSFERRING) != 0)
{
    GeckoResponse rsp = new GeckoResponse(aRequest);
    if (rsp.ContentType == "application/x-executable")
    {
        // do something
    }
}

There's also some information at http://developer.mozilla.org/en/docs/XU … ad_dialogs about implementing download dialogs but I haven't actually tried it.

Do you put this in Geckowebrowser.cs ?

Offline

 

#14 February 12, 2010 6:18 AM

cheesekun
Member
Registered: February 11, 2010
Posts: 2

Re: Download file ?

I still cant get downloads to work...

Can anyone help?????

Using xulrunner 1.9.0.4   VB.net 2008 and copied accross GeckoFX chrome files.

Offline

 

#15 April 11, 2010 4:18 AM

knox
Member
Registered: April 11, 2010
Posts: 1

Re: Download file ?

I've got the exact same problem as cheesekun. I think.
Downloads work perfectly when the location url contains the file extension, but not when the file type is determined by content-type.

Anybody found a solution?

Offline

 

Board footer