上载文件

时间:2018-08-06 14:50:26

标签: javascript jquery html sharepoint-online sharepoint-jsom

我一直试图将HTML代码中的文档上传到Sharepoint文档库。 我用谷歌搜索,但找不到确切的分辨率。这是我想要做的。任何帮助将不胜感激。

</style>
<p> 
   <u><b>Submit a matching/standardization request</b></u></p>
<div id="myDIV2">
   <table>
      <tbody> 
         <tr class="border_bottom" bgcolor="#ffa07a"> 
            <td>Templates</td> 
         </tr>
         <tr> 
            <td> 
               <font size="2"><b> Select and Download template(s)</b></font></td> 
         </tr>
         <tr>
            <td> 
               <a href="link"><u>Source File</u></a></td>
         </tr> 
         <tr>
            <td> 
               <a href="link">Destination File</a></td> 
         </tr>
      </tbody> 
   </table>
</div>
<div>
   <p>description<br/></p>
   <table>
      <tbody> 
         <tr>
            <td id="one"> 
               <input name="click" onclick="myFunction()" type="radio"/>Standardize a file</td>
         </tr> 
         <tr>
            <td id="two"> 
               <input name="click" onclick="myFunction1()" type="radio"/>Match two files</td> 
         </tr>
      </tbody> 
   </table>
</div>
<div id="myDIV" style="display: none;">
   <table>
      <tbody> 
         <tr>
            <td id="one">Upload File 
               <input type="file"/></td> 
         </tr>
         <tr> 
            <td>For Files larger than XX record, please store and provide the Orcale path below:</td> 
         </tr>
         <tr> 
            <td> 
               <input type="upload"/> 
            </td> 
         </tr>
      </tbody> 
   </table>
</div>
<div id="myDIV1" style="display: none;">
   <table>
      <tbody> 
         <tr>
            <td id="one">Upload Source File<input type="file"/></td>
         </tr> 
         <tr>
            <td id="two">Upload Reference File<input type="file"/></td> 
         </tr>
      </tbody> 
   </table>
</div>
<br/>
<br/> 
<a href="mailto:emailID?Subject=Uploading%20new%20forms"><button type="button">Submit</button></a><br/><script>
var x = document.getElementById("myDIV");
var y = document.getElementById("myDIV1");
function myFunction() {
        if (x.style.display === "none") {
        x.style.display = "block";
        y.style.display="none";
    } else {
        x.style.display = "none";
    }
}
function myFunction1() {

    if (y.style.display === "none") {
        y.style.display = "block";
        x.style.display = "none";
    } else {
        y.style.display = "none";
        x.style.display = "block";
    }
}
</script>

现在,我需要的是在“选择文件”选项旁边,应该有一个上传按钮,该按钮应该将上载的文档保存到sharepoint中的文档库中。 所有这些都添加到CEWP中。

0 个答案:

没有答案