1. Edit the document library list display page, such as:
2, add content editor, such as:
3, add the following in the "Content editor"-"edit source", add the following JS code, such as:
?
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.target= "_blank";
}
});
$ ("a[onclick*= ' Dispex ')"). Removeattr (' onclick ');
});
</script>???????????????????
4. Make sure to save the page.
5, test, upload the SWF file in the document library, open as follows:
Tips:
Ø How to implement the SP's document library similar to the effect of Baidu document library, you can run Windows services in the background or timerjob upload the various documents into the SWF file.
Ø if Ppt\word\excel\txt and other documents are converted into PDF files
Ø use pdf2swf to convert PDF to SWF (PDF file cannot be encrypted or cannot be converted)
pdf2swf
: http://www.swftools.org/download.html
Note: The Chinese name Google and Firefox browser issues
this 2 a browser default start URL address encoding. such as:
If you use manual client to go off not realistic. Only use code to determine whether Firefox and Google Browser, if not the Chinese to code, such as:
How to implement the SP document library similar to the effect of Baidu document library (subtitle: How to display the SWF file in the SP2013 document library with Flexpager)