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
Nauman FarooqPosted Dec 17, 2008, 1:41 AM
Bechir BejaouiPosted Dec 2, 2008, 1:01 PM
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 FarooqPosted Dec 2, 2008, 4:11 AM
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 BejaouiPosted Dec 2, 2008, 3:59 AM
Is it the unzipped file the endomaged or the zip file it self?
Nauman FarooqPosted Dec 2, 2008, 12:16 AM
Bechir BejaouiPosted Dec 1, 2008, 1:13 PM
Nauman FarooqPosted Dec 1, 2008, 4:53 AM
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 BejaouiPosted Dec 1, 2008, 4:30 AM
Nauman FarooqPosted Dec 1, 2008, 1:24 AM
I have given the credentials also, but got no sucess.
Bechir BejaouiPosted Nov 30, 2008, 12:21 PM
client.UploadFile("yourAdress","PUT","yourfilepath");
oClient.DownloadFile("yourAdress", "yourFilepath");