Issue metadata
Sign in to add a comment
|
downloading .aspx page instead an .exe file
Reported by
cnr.ch...@gmail.com,
Aug 9 2017
|
||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36 Steps to reproduce the problem: 1. write a c# code to download an .exe file 2. .aspx page will donwload instead .exe file 3. What is the expected behavior? should download the requested file. What went wrong? downloading .aspx page instead .exe Did this work before? No Does this work in other browsers? Yes Chrome version: 60.0.3112.90 Channel: stable OS Version: 10.0 Flash Version: other browsers are working fine (IE and Firefox)
,
Aug 9 2017
here is the c# code:
private void ProvideDownloadFile(string url)
{
byte[] imageData = null;
string filename = "DataCardServerSetup.exe";
using (var wc = new WebClient())
{
WebProxy proxy = WebProxy.GetDefaultProxy();
wc.Proxy = proxy;
imageData = wc.DownloadData(url);
}
using (Stream stream = new MemoryStream(imageData))
{
int bufferSize = 0;
Response.Clear();
Response.Buffer = true;
Response.ClearHeaders();
Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "no-cache");
Response.ClearContent();
Response.AppendHeader("Content-Disposition:", "attachment; filename=\"" + filename + "\"");
Response.AppendHeader("Content-Length", stream.Length.ToString());
Response.ContentType = "application/octet-stream";
byte[] byteBuffer = new byte[bufferSize + 1];
MemoryStream memStrm = new MemoryStream(byteBuffer, true);
while (stream.Read(byteBuffer, 0, byteBuffer.Length) > 0)
{
Response.BinaryWrite(memStrm.ToArray());
Response.Flush();
}
Response.Close();
Response.End();
memStrm.Close();
}
}
,
Aug 9 2017
Can you provide a live site to reproduce the issue? What's the content of the .aspx file downloaded by Google Chrome?
,
Aug 11 2017
I cannot give live site details. content of the download file is executable file ( .exe )
,
Aug 11 2017
Thank you for providing more feedback. Adding requester "tkent@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Aug 17 2017
,
Aug 24 2017
The NextAction date has arrived: 2017-08-24
,
Aug 28 2017
,
Aug 31 2017
Will take a look. |
|||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||
Comment 1 by cnr.ch...@gmail.com
, Aug 9 2017