<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"></script><script type="text/javascript">
function uploadFile() {
var filePath = "c:\\test.pdf";
var soapEnv =
"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \
<soap:Body>\
<CopyIntoItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>\
<SourceUrl>" + filePath + "</SourceUrl>\
<DestinationUrls>\
<string>http://ghy/Shared Documents/test.pdf</string>\
</DestinationUrls>\
<Fields>\
<FieldInformation Type='Text' DisplayName='Title' InternalName='Title' Value='Test' />\
</Fields>\
<Stream>base64Binary</Stream>\
</CopyIntoItems>\
</soap:Body>\
</soap:Envelope>";
$.ajax({
url: "http://sharepointsite/_vti_bin/copy.asmx",
beforeSend: function (xhr) { xhr.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/CopyIntoItems"); },
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processResult,
contentType: "text/xml; charset=\"utf-8\""
});
}
function processResult(xData, status) {
alert("Uploaded SuccessFully");
}</script><input name="Upload" onclick="uploadFile()" type="button" value="Upload"/>

ECMA 上传文件到SHarePoint 文档库的更多相关文章

  1. 上传文件到 Sharepoint 的文档库中和下载 Sharepoint 的文档库的文件到客户端

    文件操作应用场景: 如果你的.NET项目是运行在SharePoint服务器上的,你可以直接使用SharePoint服务器端对象模型,用SPFileCollection.Add方法 http://msd ...

  2. 修改Sharepoint 文档库列表点击Excel文件默认跳转到Excel Service服务 xlviewer.aspx页面

    在Sharepoint 文档库中,当点击库中的一个Excel文件时,Sharepoint默认为转跳到Excel Services上,无论是Sharepoint 的是否开启了Excel Service, ...

  3. Plupload上传插件中文帮助文档

    Plupload上传插件中文帮助文档 配置参数 实例化一个plupload对象时,也就是 new plupload.Uploader(),需要传入一个对象作为配置参数.后面内容中出现的plupload ...

  4. C# 对sharepoint 列表的一些基本操作,包括添加/删除/查询/上传文件给sharepoint list添加数据

    转载:http://www.cnblogs.com/kivenhou/archive/2013/02/22/2921954.html 操作List前请设置SPWeb的allowUnsafeUpdate ...

  5. SharePoint 文档库实现文件夹拖放到文档库

    打开文档库-> 选择文件夹-> 在Ribbon中选择“库(list)”-> 在右边可以看到打开方式-> 选择用资源管理器打开-> 在新打开的资源管理器中可能实现对文夹的拖 ...

  6. 在Outlook中查看预览SharePoint文档库的文档

    本文概况 阅读时间: 约2分钟 适用版本:SharePoint Server 2010及以上 面向用户:普通用户,管理员 难度指数:★★☆☆☆ 在日常工作中,总有一些常用的文档需要经常打开查看,其实我 ...

  7. 360安全卫士造成Sharepoint文档库”使用资源管理器打开“异常

           备注:企业用户还是少用360为妙        有客户反馈:部门里的XP SP2环境客户机全部异常,使用资源管理器打开Sharepoint文档库,看到的界面样式很老土,跟本地文件夹不一样 ...

  8. 解决SharePoint 文档库itemadded eventhandler导致的上传完成后,编辑页面保持报错的问题,错误信息为“该文档已经被编辑过 the file has been modified by...”

    在文档库中添加itemadded 后,在上传文件后,会自动打开文档属性的编辑页面,在保存的时候就会报错,说这个文档已经被编辑过了.这是应为默认itemadded实践是异步执行的,会在edit页面打开之 ...

  9. 文件的上传(可以上传照片,word文档,等单个文件)

    jsp: jsp页面: <LINK href="${basePath}plugins/uploadify/uploadify.css" type="text/css ...

随机推荐

  1. python中的raw字符串

    在正则表达式的字符串前面加上r表示这个是一个raw字符串,只以正则表达式的元字符进行解析,不用理会ascii的特殊字符.

  2. Failed to load http://wantTOgo.com/get_sts_token/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://fromHere.com' is therefore not allowed access.

    Failed to load http://wantTOgo.com/get_sts_token/: No 'Access-Control-Allow-Origin' header is presen ...

  3. abap 打开文件对话框

    [转自 http://blog.csdn.net/zhongguomao/article/details/6712576] *----------------------- Method 1 ---- ...

  4. MySQL——sql语句的执行顺序

    #核心知识点: 书写顺序:where——>group by——>having——>order by——>limit 许多时候在书写一些复杂的sql语句的时候,尤其是在渐进式推导 ...

  5. Linux 下使用C语言 gets()函数报错

    在Linux下,使用 gets(cmd) 函数报错:warning: the 'gets' function is dangerous and should not be used. 解决办法:采用 ...

  6. tkinter之对话框

    对话框的一个例子: from tkinter.dialog import * from tkinter import * def investigation(): d=Dialog(None,titl ...

  7. HDU 4405 Aeroplane chess:期望dp

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4405 题意: 你在下简化版飞行棋... 棋盘为一个线段,长度为n. 上面有m对传送门,可以直接将你从a ...

  8. Custom Database Integration Guide

    Introduction This document provides instructions for integrating Openfire authentication, users, and ...

  9. struts2的通配符与动态方法调用

    1.Action标签中的method属性 我们知道action默认的执行的方法是execute方法,但是一个action只执行一个方法我们觉得有点浪费,我们希望在一个action中实现同一模块的不同功 ...

  10. mysql之count

    两种引擎对count的处理 CREATE TABLE `test` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` char(15) D ...