使用JSOM在文档库中上载文件时出错 [英] Error while uploading file in document library using JSOM

查看:84
本文介绍了使用JSOM在文档库中上载文件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好专家,

我想在文件库中上传文件,但在上传文件时,文件上传成功,但之后没有成功的方法。

I want to upload file in document library but while uploading file, file uploaded successfully but after that not going in success methods.

错误:  值不在预期范围内。

我使用下面的代码上传文件

I use below code to upload file

推荐答案

嗨sachsoni, 

Hi sachsoni, 

在SharePoint页面中添加内容编辑器Web部件。

创建.txt文件并将下面给出的代码保存在txt文件中。 Ex-" fileUpload.txt"

在网站资源库中上传fileUpload.txt。 
$
请参阅CEWP的脚本文件并保存页面。

Add Content Editor Web part in SharePoint page.
Create a .txt file and save the code given below in txt file. Ex- "fileUpload.txt"
Upload fileUpload.txt in Site Assets library. 
Refer the script file from CEWP and save the page.

fileUpload.txt - 代码:

fileUpload.txt - Code:

<html>  
  
    <head>  
        <script language="javascript" type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>  
        <script language="javascript" type="text/javascript">  
var fileInput;


(document)
.ready(function(){
fileInput =
(document) .ready(function () { fileInput =


( " #getFile");
SP.SOD.executeFunc('sp.js','SP.ClientContext',registerClick);
});

函数registerClick(){
//注册文件上传点击事件
("#getFile"); SP.SOD.executeFunc('sp.js', 'SP.ClientContext', registerClick); }); function registerClick() { //Register File Upload Click Event


这篇关于使用JSOM在文档库中上载文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆