I tried WebClient, HttpWebRequest, WebRequest and couple other ways to download file from specific server but every time the file is empty (0 byte). I discovered that in the response headers:
Pragma: Public
Content-Disposition: attachment; filename="hQPDAU0.mp3"
Content-Transfer-Encoding: binary
Connection: close
Accept-Ranges: bytes
Content-Length: 0
Cache-Control: max-age=1468800
Content-Type: audio/mpeg
Date: Tue, 08 Jul 2014 08:52:05 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Set-Cookie: sessioncode=4v0jgqiq.....1kulouk0c01; path=/; domain=.domain
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.4.29
the Conent-Length is 0. I've opened the URL in my browser and it forced it to download file. But how can I download file in C#?