在网页上连接Microsoft PowerPoint文件,如何只能供浏览,而不能被下载。
在网上搜索一下,发现有如下解决方法:
特留下记号:方法没有验证
1.在web.xml中加:
<mime-mapping>
<extension>ppt</extension>
<mime-type>application/mspowerpoint</mime-type>
</mime-mapping>
2.
你可以修改response.contenttype的值,比如
response.contenttype="application/pdf" ;
response.writefile(request.physicalapplicationpath + "test.pdf");
response.end();
不懂powerpoint是的contenttype是什么,可以去查一下。
Response.ContentType = "application/x-msdownload ; Charset=utf-8";
Response.AddHeader("Content-Disposition", "attachment; filename=...");
3.
还是自己写一个activex吧。这样安全性也要好一些。
至于ppt的显示部分可以考虑使用微软提供的powerpointviewer。
4.
只要能让用户看到的,就能被下载!
最笨的方法就是用"printscreen key".