如何上传文件到SharePoint文件夹 [英] How to upload a file to SharePoint folder

查看:1708
本文介绍了如何上传文件到SharePoint文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图将文件上传到我的SharePoint 2013服务器。我是从Android应用程序使用REST API这样做。

我只能上传文本文件(TXT即/ RTF)。

这是我该怎么办:

我打的网址:

<$p$p><$c$c>https://mysite.com/me/username/_api/Web/GetFolderByServerRelativeUrl('/me/username/Documents')/Files/Add(url='testingUpload.txt',覆盖=真)

标题:

 接受:应用/ JSON; ODATA =冗长',
binaryStringRequestBody:真实,
'状态:'更新',
X-RequestDigest':其中; X-requestDigest&GT;
内容长度:CONTENTLENGTH

在身上,我发送文件的内容(字符串格式)。
问题是当我上传PDF,图像或任何其他非文本文件。

请告诉正确的方法是什么。非常感谢! :)


解决方案

请检查此链接。他是能够上传文件在SharePoint。我希望你,code的帮助。
计算器<一个href=\"http://stackoverflow.com/questions/15762424/uploading-docx-doc-and-pdf-file-to-sharepoint-online-from-native-android-app\">URL:

I've been trying to upload files to my SharePoint 2013 server. I'm doing this from an Android app using REST API.

I can only upload text files (i.e txt/rtf).

This is how I do:

The URL I hit:

https://mysite.com/me/username/_api/Web/GetFolderByServerRelativeUrl('/me/username/Documents')/Files/Add(url='testingUpload.txt', overwrite=true)

Headers:

'Accept' : 'application/json;odata=verbose',
'binaryStringRequestBody' : true,
'state : 'Update',
'X-RequestDigest' : <x-requestDigest>
'Content-Length' : contentLength

In the body, I send the contents of the file (in string format). The problem comes when I upload a PDF, an image or any other non-text file.

Please tell what the correct method would be. Thanks a lot! :)

解决方案

Please check this link. He is able to upload file in SharePoint. I hope that code help you. stackoverflow URL:

这篇关于如何上传文件到SharePoint文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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