473,770 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebClient DownloadFile over ssl / https

Can anyone get this to work? All Im getting is the login html being
downloaded.

Would appreciate any help - my heads hurts

Thanks
Gav

Aug 2 '06 #1
4 14286
gavkel,

What do you mean the login html? If you are getting a response at all,
then it indicates that you are not having any problems with the SSL
connection or HTTPS.

Can you provide some sample code?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"gavkel" <ga****@hotmail .comwrote in message
news:11******** *************@s 13g2000cwa.goog legroups.com...
Can anyone get this to work? All Im getting is the login html being
downloaded.

Would appreciate any help - my heads hurts

Thanks
Gav

Aug 2 '06 #2
Ok

Uri uri = new
Uri("https://www.scoobydoo.c om/downloads/velma_statistic s.csv");
WebClient webClient = new WebClient();

CredentialCache mycache = new CredentialCache ();
mycache.Add(new Uri("https://www.scoobydoo.c om/home.html"),
"Basic", new NetworkCredenti al("scoobydooby doo", "Passw0rd") );
webClient.Crede ntials = mycache;

webClient.Downl oadFile(uri, @"c:\gav.txt ");

Now, whats happening is Im trying to download velma_statistic s.csv (cos
I love her!!) but its over HTTPS. I can see whats happening - when I
copy and paste the contents of the downloaded gav.txt into a html page
in VS, I get the login page that I would need to firstly complete in IE
before successfully downloading my csv file, again manually.

So, any ideas? By the way, I like Daphne too but me and Velma have
always had a thing going on...

Thanks

Aug 3 '06 #3
Ok

Uri uri = new
Uri("https://www.scoobydoo.c om/downloads/velma_statistic s.csv");
WebClient webClient = new WebClient();

CredentialCache mycache = new CredentialCache ();
mycache.Add(new Uri("https://www.scoobydoo.c om/home.html"),
"Basic", new NetworkCredenti al("scoobydooby doo", "Passw0rd") );
webClient.Crede ntials = mycache;

webClient.Downl oadFile(uri, @"c:\gav.txt ");

Now, whats happening is Im trying to download velma_statistic s.csv (cos
I love her!!) but its over HTTPS. I can see whats happening - when I
copy and paste the contents of the downloaded gav.txt into a html page
in VS, I get the login page that I would need to firstly complete in IE
before successfully downloading my csv file, again manually.

So, any ideas? By the way, I like Daphne too but me and Velma have
always had a thing going on...

Thanks

Aug 3 '06 #4
Thus wrote gavkel,
Ok

Uri uri = new
Uri("https://www.scoobydoo.c om/downloads/velma_statistic s.csv");
WebClient webClient = new WebClient();
CredentialCache mycache = new CredentialCache ();
mycache.Add(new
Uri("https://www.scoobydoo.c om/home.html"),
"Basic", new NetworkCredenti al("scoobydooby doo", "Passw0rd") );
webClient.Crede ntials = mycache;
webClient.Downl oadFile(uri, @"c:\gav.txt ");

Now, whats happening is Im trying to download velma_statistic s.csv
(cos I love her!!) but its over HTTPS. I can see whats happening -
when I copy and paste the contents of the downloaded gav.txt into a
html page in VS, I get the login page that I would need to firstly
complete in IE before successfully downloading my csv file, again
manually.

So, any ideas? By the way, I like Daphne too but me and Velma have
always had a thing going on...
You'll need to use HttpWebRequest and HttpWebResponse to programmtically
log in to the web site and fetch the file. That's a FAQ, so your favorite
search engine should provide you a lot of references to check out.

Cheers,
--
Joerg Jooss
ne********@joer gjooss.de
Aug 7 '06 #5

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

Similar topics

1
4273
by: James Write | last post by:
Hi, I am using the webclient.downloadfile() method to download a file from a remote web server to the local harddrive. public CopyFile(string sSrcPath, string sDestPath) { WebClient oClient = new WebClient(); oClient.DownloadFile(sSrcPath,sDestPath); }
6
13303
by: A.M-SG | last post by:
Hi, I have an aspx page at the web server that provides PDF documents for smart client applications. Here is the code in aspx page that defines content type: Response.ContentType = "application/octet-stream"; Response.AppendHeader("Content-Disposition", "attachment;filename=" + fileID.ToString() + ".pdf");
1
4804
by: Cheri Elkin | last post by:
I recieve the following error when attempting to download a file from our web server to be placed on our hard drive. Any clues as to why I would get this error? By the way, the directory already exists on the hard drive ("c"). System.Net.WebException: An exception occurred during a WebClient request. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path "C:\Essex\Download\POLEXPT1.DT1". at...
8
9025
by: DEWright_CA | last post by:
Why does WebClient.DownloadFile loose my completed path? Ok, I have a function in my app then when my button is clicked it checks to see if the files come from a local drive or a http address. The portion of the code that pulls from the drive works great, but when the http address is active it changes the originating path to my C:\Windows\System32 folder instead of the proper path. I keep the path as a field on my form so I am certain...
1
2933
by: peter.rietmann | last post by:
I have been suddenly having a performance problem downloading images from one server (productive) to another (productive) using the following code .. WebClient webClient = new WebClient(); try { webClient.DownloadFile(sourceUrlFilename, destinationFilename); } catch (Exception ex)
2
3257
by: Lila Godel | last post by:
I am having a problem with the download of web pages via the WebClient.DownloadFile function in the specialized VB.Net 2003 I.E. plug-in I am designing to speed up the work on my latest project. When I edit the web pages in notepad I see a square wherever I normally see a carriage return and a line feed when viewing the source in I.E. How can I make the web pages come down readable so I can easily make my two manual deletions...
1
4778
by: David Satz | last post by:
Hello--I just upgraded to Visual Studio .NET 2005 and suddenly, all my .NET 1.1 applications that accessed Web sites have broken. For example, this code: WebClient wc = new WebClient(); wc.DownloadFile("http://www.microsoft.com/", "MSFT.htm"); .... throws a WebException on the second line. The WebException doesn't specify a problem, but it has an InnerException of type NullReferenceException with the following stack trace:
2
4935
by: gavkel | last post by:
Can anyone get this to work? All Im getting is the login html being downloaded. Would appreciate any help - my heads hurts Thanks Gav
8
9523
by: =?Utf-8?B?UnVpIE9saXZlaXJh?= | last post by:
WebClient.DownloadFile I am using the WebClient.DownloadFile function to download a file from server to a local client. When I execute the below code, file is created in server and not in client. What am I doing wrong?
0
9595
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9432
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10059
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8891
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
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 we have to send another system
2
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2822
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.