Hi Guys

I am trying to use below code to show a save dialog box when a link with .swf file is clicked, But the problem is that its not working.
Can anyone share the code to show a save dialoge box when a link is clicked with .swf file extention. Please see the below code, I am calling it on htmlanchor click event. Let me know if there are any other soltions..Thanks

try
            {
                HtmlAnchor anchor = (HtmlAnchor)sender;
                System.IO.FileInfo targetfile = new System.IO.FileInfo(anchor.HRef);

                if (targetfile.Exists)
                {
                    Response.Clear();
                    Response.AddHeader("Content-Disposition", "attachment; filename=" + targetfile.Name);
                    Response.AddHeader("Content-Length", targetfile.Length.ToString());
                    Response.ContentType = "application/x-shockwave-flash";
                    Response.WriteFile(targetfile.FullName);
                }
            }
            catch (Exception ex)
            {
                LogException(ex);
            }

I changed content-type to "application/X-unknown" and it worked for me..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.