I have read your article on connecting and downloading a file from HTTP
and Proxy server through C#.NET. Currently i am working on an
application that would upload and download files from a HTTPS server,
without any proxy server between. but i cannot get through it. Somewhat
using your code in the above article i get the message in the resultant
string that "Virtual user logged in". I am kind of stuck in this
scenario.
Could you kindly help me out of it.
Loading

Bechir BejaouiRank #144 · 15.9K reputationPosted Nov 30, 2008, 7:21 AM EST
client.UploadFile("yourAdress","PUT","yourfilepath");
oClient.DownloadFile("yourAdress", "yourFilepath");
Nauman Farooq18 reputationPosted Nov 30, 2008, 8:24 PM EST
I have given the credentials also, but got no sucess.
Bechir BejaouiRank #144 · 15.9K reputationPosted Nov 30, 2008, 11:30 PM EST
Nauman Farooq18 reputationPosted Nov 30, 2008, 11:53 PM EST
On a close look reveals that the repose i get after my download statement is "Virtual User logged in", and every time i get this error.
I have allowed all certificates in my certificate policy.
Bechir BejaouiRank #144 · 15.9K reputationPosted Dec 1, 2008, 8:13 AM EST
Nauman Farooq18 reputationPosted Dec 1, 2008, 7:16 PM EST
Bechir BejaouiRank #144 · 15.9K reputationPosted Dec 1, 2008, 10:59 PM EST
Is it the unzipped file the endomaged or the zip file it self?
Nauman Farooq18 reputationPosted Dec 1, 2008, 11:11 PM EST
Dim filefullpath As String
Dim fileurl As String = "HTTPS url"
Dim filedownload As String = "filename"
Dim newfilename As String = "saved filename"
Dim filepath As String = "D:\"
Dim userid As String = "userid"
Dim userpassword As String = "password"
fullfiledownload = fileurl & filedownload
filefullpath = filepath & newfilename
ServicePointManager.CertificatePolicy = New Certpolicy() //returning true for all certificates.
Dim wc As New WebClient
Dim myCredentials As New NetworkCredential(userid, userpassword)
wc.Credentials = myCredentials
wc.DownloadFile(fullfiledownload, filefullpath)
this code is giving me error "The remote server returned an error: (401) Unauthorized ". I dont know why.
I am using Serv-U for making an HTTPS server. and connecting to it.
Bechir BejaouiRank #144 · 15.9K reputationPosted Dec 2, 2008, 8:01 AM EST
Are you sure that your ID and Password are corrects or even they are correct they have to be valid
Could you try to access from a computer to which you have never previously identified? but change the userID and the password try this, i said that because I have a doubt about the surrounding systems whether they have been configured to disallow certain patterns of HTTP traffic.
Nauman Farooq18 reputationPosted Dec 16, 2008, 8:41 PM EST