Uploading Files to HTTPS site [modified]
-
Gud day everyone, I want to upload files to an HTTPS site... the said site will ask a user name and a password upon opening the page. It will also ask another username & password when uploading the file... problems: 1. my pc is behind a proxy server. 2. I did not find any solutions or sample codes to connect and upload into an HTTPS site. None of those samples I tried did not work or probably i just don't know how to use it. 3. I don't really understand the difference between HTTP and HTTPS except the latter will ask a username & a password. 4. I don't have a test HTTPS site because i don't know how to create one... One time i encountered an error "System.Net.WebException The underlying connection was closed. Could not establish trust relationship with remote server." Can i force the server to accept my certificate??? or do you have any solutions of my problems by all means..... Hoping somebody can give thier brilliant solutions regarding this matter.... Thank you in advance....
xxx
modified on Tuesday, July 14, 2009 5:40 AM
-
Gud day everyone, I want to upload files to an HTTPS site... the said site will ask a user name and a password upon opening the page. It will also ask another username & password when uploading the file... problems: 1. my pc is behind a proxy server. 2. I did not find any solutions or sample codes to connect and upload into an HTTPS site. None of those samples I tried did not work or probably i just don't know how to use it. 3. I don't really understand the difference between HTTP and HTTPS except the latter will ask a username & a password. 4. I don't have a test HTTPS site because i don't know how to create one... One time i encountered an error "System.Net.WebException The underlying connection was closed. Could not establish trust relationship with remote server." Can i force the server to accept my certificate??? or do you have any solutions of my problems by all means..... Hoping somebody can give thier brilliant solutions regarding this matter.... Thank you in advance....
xxx
modified on Tuesday, July 14, 2009 5:40 AM
The_Collector wrote:
my pc is behind a proxy server.
How does that matter
The_Collector wrote:
I did not find any solutions or sample codes to connect and upload into an HTTPS site. None of those samples I tried did not work or probably i just don't know how to use it.
The program does not change for a http or https site.
The_Collector wrote:
I don't really understand the difference between HTTP and HTTPS except the latter will ask a username & a password
That not true. Https has nothing to with the authentication(i.e. asking for username and password) Good explanation here[^]
The_Collector wrote:
I don't have a test HTTPS site because i don't know how to create one...
You can create one like this[^]
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
The_Collector wrote:
my pc is behind a proxy server.
How does that matter
The_Collector wrote:
I did not find any solutions or sample codes to connect and upload into an HTTPS site. None of those samples I tried did not work or probably i just don't know how to use it.
The program does not change for a http or https site.
The_Collector wrote:
I don't really understand the difference between HTTP and HTTPS except the latter will ask a username & a password
That not true. Https has nothing to with the authentication(i.e. asking for username and password) Good explanation here[^]
The_Collector wrote:
I don't have a test HTTPS site because i don't know how to create one...
You can create one like this[^]
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
regarding the making of a test server, i had read that link you provid but its totally deffrfent from what is n actual.... we have a windows server 2000 as our test server.... do u have a sample code as my basis???? i rerally need it badly... thanks
xxx
-
The_Collector wrote:
my pc is behind a proxy server.
How does that matter
The_Collector wrote:
I did not find any solutions or sample codes to connect and upload into an HTTPS site. None of those samples I tried did not work or probably i just don't know how to use it.
The program does not change for a http or https site.
The_Collector wrote:
I don't really understand the difference between HTTP and HTTPS except the latter will ask a username & a password
That not true. Https has nothing to with the authentication(i.e. asking for username and password) Good explanation here[^]
The_Collector wrote:
I don't have a test HTTPS site because i don't know how to create one...
You can create one like this[^]
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
HI, to explain more... a popup window will appear like "http://www.zoneedit.com/auth/" i'll be task to develop a program which will upload a file automatically on a given time without human intervention... I have d user & password but i dont know how to do it.... I made a lot of efforts but none is working... below is my coding i used.. private void btnUpload_Click(object sender, EventArgs e) { try { System.Net.ServicePointManager.CertificatePolicy = new MyPolicy(); string uploadData = "user=" + TxtUser.Text + "&password=" + TxtPassword.Text; ; ASCIIEncoding encoding = new ASCIIEncoding(); byte[] uploadByte = encoding.GetBytes(uploadData); // Create the HttpWebRequest and set its properties HttpWebRequest request = (HttpWebRequest)WebRequest.Create(TxtSite.Text); request.ContentLength = uploadData.Length; request.ContentType = "application/x-www-form-urlencoded"; request.Method = "POST"; request.Timeout = 20000; // Get a Stream from the HttpWebRequest and write login info to it Stream uploadStream = request.GetRequestStream(); uploadStream.Write(uploadByte, 0, uploadByte.Length); WebClient Client = new WebClient(); Client.UploadFile(TxtSite.Text, TxtFile.Text); } catch (Exception expx) { MessageBox.Show(expx.Message); } } tnx in advance
xxx