1. Edit the document library list display page, for example:
2. Add a Content Editor, such:
3. Add the following JavaScript code in [Content Editor]-[edit source] and add the following JavaScript code, for example:
?
The Code is as follows:
<Scrip type = "text/JavaScript" src = "/siteassets/jquery-1.4.1.js"> </SCRIPT>
<SCRIPT type = "text/JavaScript">
$ (Function (){
// Force Document Library Document Download
$ ("A [onclick * = 'dispex']"). Each (function (){
VaR href = This. href;
If (href. indexof (". SWF")> = 0)
{
This. href = 'HTTP: // 192.168.56.146: 8001/_ layouts/15/sharepointproject2/flexpaper/index.html? Sourceurl = '+ this. href;
This.tar get = "_ blank ";
}
});
$ ("A [onclick * = 'dispex']"). removeattr ('onclick ');
});
</SCRIPT> ???????????????????
4. Confirm to save the page.
5. Test: Upload the SWF file in the document library and open it as follows:
Tip:
? How to realize the effect of SP document library similar to Baidu document library, you can run Windows service or timerjob in the background to convert uploaded documents into SWF files.
? Convert PPT \ word \ Excel \ TXT and other files into PDF files.
? Convert a PDF file into a SWF file using SWF (the PDF file cannot be encrypted, otherwise it cannot be converted)
Ipv2swf
: Http://www.swftools.org/download.html
Note: Chinese name: Google and Firefox
This 2Default start URL of browsersAddress encoding. For example:
It is unrealistic to manually close the client one by one. You only need to use the code to determine whether it is Firefox or Google's browser. If not, you need to encode it in Chinese, for example: