473,465 Members | 4,823 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

MS Web Browser + .NET - File download dialog problem.

Hello all!

I'm writing a simple C# application, that should day by day open a
particular web site and download a text file (new file is generated by
the server daily).

I'm using Microsoft Web Browser ActiveX, and I cannot simply provide
the file URL in my app, because of:

1) First, I should provide credentials to enter the site
2) I should execute a script to generate a page containing list of
files
3) I should parse a page to find a link to the particular file (file
URL)

So far I succeeded with all these steps and this is what I'm actually
having problem with:

When I execute Navigate method on a file url, the file download dialog
appears. I don't need the dialog, but unfortunately don't know how to
skip it, just download the file and save it to some folder.

For now I'm using another approach - fortunately the web site provides
the way to view the content of file inside a web page, so I'm loading
the page an grabbing its contents... But I don't like this anyway.

Any help appreciated.

May 1 '06 #1
3 2038
Use a HttpWebRequest object to get the page instead.

Uncle_Bob wrote:
Hello all!

I'm writing a simple C# application, that should day by day open a
particular web site and download a text file (new file is generated by
the server daily).

I'm using Microsoft Web Browser ActiveX, and I cannot simply provide
the file URL in my app, because of:

1) First, I should provide credentials to enter the site
2) I should execute a script to generate a page containing list of
files
3) I should parse a page to find a link to the particular file (file
URL)

So far I succeeded with all these steps and this is what I'm actually
having problem with:

When I execute Navigate method on a file url, the file download dialog
appears. I don't need the dialog, but unfortunately don't know how to
skip it, just download the file and save it to some folder.

For now I'm using another approach - fortunately the web site provides
the way to view the content of file inside a web page, so I'm loading
the page an grabbing its contents... But I don't like this anyway.

Any help appreciated.

May 1 '06 #2
I'm not sure it could be done this way, as there's an authentication
procedure I mentioned above. If I would ask server for the file url
directly, it will come up with HTTP 403 and redirect me to the login
page.

May 2 '06 #3
You can pass authentication information through either webrequest or
webclient.

See the WebRequest.Credentials property
http://msdn2.microsoft.com/en-us/lib...ls(VS.80).aspx

Cheers,

Greg
"Vladimir Zinchenko" <vz********@inbox.ru> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
I'm not sure it could be done this way, as there's an authentication
procedure I mentioned above. If I would ask server for the file url
directly, it will come up with HTTP 403 and redirect me to the login
page.

May 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Brad | last post by:
In several aspx applications I export crytal reports to pdf, xls and doc files and then the aspx page writes the selected export file to the client browser. This all works with one small quirk: ...
2
by: Sam-Kiwi | last post by:
I've spent the last 6 months developing a pay-per-download website using ASP.NET Users purchase documents and then download them. The intention is that users are only charged for documents...
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
2
by: Ken Varn | last post by:
I have an ASP.NET page that incorporates the following code on a button press. private void DownloadTag_Command(object sender, CommandEventArgs e) { FileStream fs; String Filename; Filename...
13
by: Daniel Walzenbach | last post by:
Hi, Imagine the following situation: I have an asp.net application which allows uploading files to a SQL Server 2000 database (Files are stored as type "images"). As a next step I would like to...
3
by: Jason | last post by:
Hi, I built a vb.Net application that creates ICS calendar files dynamically and then sends them to the client browser as a downloadable file. Works perfectly except in the following situation....
2
by: msxkim | last post by:
My web app writes some binary data to a file at the client site via Response.BinaryWrite. This action is accomplished in response to a button click, with C# code behind as follows: private void...
0
by: XcOd | last post by:
Hi , I have made an application using C# and it has a webbrowser component in it. The user navigates to the webpage he/she wishes to. When a link is clicked to download a file, the "File Download"...
1
by: RN1 | last post by:
In an ASP.NET app, users can upload their files to a remote server as back-up. I want to give users the provision to download files that they have uploaded to the remote server to their local...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.