New issue
Advanced search Search tips

Issue 753864 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: 2017-08-24
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

downloading .aspx page instead an .exe file

Reported by cnr.ch...@gmail.com, Aug 9 2017

Issue description

UserAgent: 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)
 
need ASAP.
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();               
            }
        }

Comment 3 by tkent@chromium.org, Aug 9 2017

Cc: tkent@chromium.org
Labels: Needs-Feedback
NextAction: 2017-08-24
Can you provide a live site to reproduce the issue?
What's the content of the .aspx file downloaded by Google Chrome?

Comment 4 by cnr.ch...@gmail.com, Aug 11 2017

I cannot give live site details.

content of the download file is executable file ( .exe ) 
Project Member

Comment 5 by sheriffbot@chromium.org, Aug 11 2017

Labels: -Needs-Feedback
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

Comment 6 by tkent@chromium.org, Aug 17 2017

Cc: -tkent@chromium.org
Components: -Blink>HTML UI>Browser>Downloads
The NextAction date has arrived: 2017-08-24
Labels: TE-NeedsTriageFromMTV
Labels: -TE-NeedsTriageFromMTV
Owner: dtrainor@chromium.org
Status: Assigned (was: Unconfirmed)
Will take a look.

Sign in to add a comment