locked
Issue with WebClient and Windows 8.1 while downloading a file RRS feed

  • Question

  • 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


    • Edited by Yasett Friday, January 16, 2015 5:28 PM
    • Moved by Caillen Sunday, January 25, 2015 8:33 AM
    Friday, January 16, 2015 5:21 PM

Answers

All replies