Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

Issue with WebClient and Windows 8.1 while downloading a file

$
0
0

Hi,

Since many of the users of my applications started to upgrade to Windows 8.1, they can't download files. Their downloads stop suddenly and the resulting files are corrupt or damaged. This only happens on Windows 8.1 and with Internet Explorer (any version). We have tried with another browsers (like Chrome or Firefox) and it works as expected. However, most of our users have Internet Explorer, so this is not a workaround.

I have tested with dozens of files and only one PDF is able to be downloaded. For this reason, I think it has to do with the encoding of the files or probably a default configuration in Internet Explorer.

The code I'm using for download is the following:

using (WebClient webClient = new WebClient())
{
    NetworkCredential nCredencial = new NetworkCredential();
    webClient.Credentials = CredentialCache.DefaultCredentials;
    byte[] archivoBytes = webClient.DownloadData(RutaOrigenArchivo + NombreArchivo);

    if (archivoByte != null & string.IsNullOrEmpty(mensaje))
    {
         Response.BinaryWrite(archivoByte);
         Response.Flush();
         Response.Close();
    }

}

Does anyone know how to fix this?

Thanks in advance,

Yas


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>