7
Answers

send a file through Http server

George George

George George

16y
3.1k
1

Hello everyone,

I am writing a console application which is using http(s) to send a couple of binary files to IIS server (an ASP.Net application). I am wondering in order to improve upload performance and reliability, which C# APIs should I use to upload files and any special points I need to consider in my scenario?

thanks in advance,
George

Answers (7)
0
Bechir Bejaoui

Bechir Bejaoui

NA 20.1k 5.3m 16y
Not at all George ;-}
0
George George

George George

NA 778 0 16y

Thanks for your advice, Bechir!

regards,

George

0
Bechir Bejaoui

Bechir Bejaoui

NA 20.1k 5.3m 16y
WebClient is the better as it allows you with a simple way  to leverage the task of uploading asynchronously as it has a special method to do that directly so it will be better for the application performance

0
George George

George George

NA 778 0 16y

Thanks Deepak,

I am new to this topic. Do you have any other reference samples for upload files?

regards,

George

0
George George

George George

NA 778 0 16y

Thanks Bechir,

I am not sure whether using WebClient or using WebHttpRequest or something else is faster? Any ideas?

regards,

George

0
Deepak

Deepak

NA 4 0 16y
I have some code on this post which may be helpful.

http://www.onedotnetway.com/code-sample-programmatically-download-file-using-c/

Regards,

Deepak
0
Bechir Bejaoui

Bechir Bejaoui

NA 20.1k 5.3m 16y

use
The System.Net and especially the WebClient object to transfer file via http