【问题标题】:display swf files on a page with httpHandler使用 httpHandler 在页面上显示 swf 文件
【发布时间】:2013-08-04 13:14:09
【问题描述】:

我想使用 http 处理程序在页面上显示 swf 文件。 AS 想为 swf src 做处理程序。 我的代码如下:

<object type="application/x-shockwave-flash" width="520" height="440">
<param name="src" value="handler/myhandler.ashx" />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="true">
<param name="StretchToFit" value="true">

服务器端的处理程序代码是:

context.Response.ContentType = "application/x-shockwave-flash";
context.Response.Write("myflash.swf");

类似问题在Can't display .swf files on a page with httpHandler
他的解决方案是“现在,我刚刚删除了所有这些值,它起作用了!我仍然不明白为什么,但它起作用了”
我没有得到他..
有人帮帮我吗

【问题讨论】:

    标签: asp.net flash handler swfobject


    【解决方案1】:

    我明白了

            HttpContext.Current.Response.ClearContent();
            HttpContext.Current.Response.ClearHeaders();
            HttpContext.Current.Response.AddHeader("Content-Disposition", string.Format("filename={0}", "tmyflash.swf"));
            HttpContext.Current.Response.AddHeader("Content-Type", "application/x-shockwave-flash");
            HttpContext.Current.Response.WriteFile("myflash.swf");
            HttpContext.Current.Response.End();
    

    和客户端

    <embed src="myhandler.ashx" >
    

    【讨论】:

      猜你喜欢
      • 2012-12-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-14
      • 2013-02-22
      • 2014-06-09
      • 2013-07-05
      • 2015-12-15
      相关资源
      最近更新 更多