How to show a save dialog box when a link with .swf file is clicked?

csharp , , web development , dotnet , dotnet framework 2.0 , visual webdevelopment Mahbūbnagar, India
  • 10 years ago

    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

                    HtmlAnchor anchor = (HtmlAnchor)sender;
                    System.IO.FileInfo targetfile = new System.IO.FileInfo(anchor.HRef);
                    if (targetfile.Exists)
                        Response.AddHeader("Content-Disposition", "attachment; filename=" + targetfile.Name);
                        Response.AddHeader("Content-Length", targetfile.Length.ToString());
                        Response.ContentType = "application/x-shockwave-flash";
                catch (Exception ex)
  • 10 years ago

    What happens when you use the code above?

    Does the file just open and play in flash player?


Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Better train people and risk they leave – than do nothing and risk they stay.” - Anonymous