Click here to Skip to main content
15,888,053 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using webclient to send file over https.

Below is my code.
C#
public class WebClientEx : WebClient
   {

       protected override WebRequest GetWebRequest(Uri address)
       {

           HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(address);

           request.ReadWriteTimeout = 2147483647;

           request.Timeout = 2147483647;

           request.SendChunked = true;

           request.AllowWriteStreamBuffering = false;
           request.ContentType = "application/octet-stream";
           // request.exnc = Encoding.UTF8;

           return request;

       }

   }


C#
WebClientEx wc = new WebClientEx();

                      wc.UploadFileAsync(new Uri(@"https://www.exmaple.com/API/FileOperations/UploadFile.svc/UploadFileStream"), "POST", file);



My problem is with HTTPS, the file streaming is dead slow. Where as with HTTP its very fast. Please help. Urgent
Posted
Comments
ZurdoDev 20-Oct-15 8:18am    
HTTPS will always be slower than HTTP due to encryption/decryption times.
Member 8787053 20-Oct-15 9:05am    
But speed has come down drastically. Some of the blogs suggest that https doesnt have impact on sped
ZurdoDev 20-Oct-15 9:06am    
It will always have an impact on speed, but usually not very noticeable.
Member 8787053 20-Oct-15 9:07am    
1 GB file which took 15 mins to upload with http took more than 5 hours with https. Is there any settings related to it in IIS?
ZurdoDev 20-Oct-15 9:11am    
That IS a huge difference. I'm not aware of anything in IIS to cause that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900