我可以将图像文件上传到SharePoint,但它不会被识别为图像.我已经尝试使用以下指令,该指令基于研究表明图像在上传到SharePoint时需要进行base64编码,但它仍然会上传一个看似已损坏的文件:https://github.com/adonespitogo/angular-base64-upload
我很高兴使用此指令,但不确定如何将我需要的内容传递到SharePoint的REST API中.
我原来的迭代不使用这个指令,但更多的是直接上传尝试.
我需要达到的目的如下:
1)成功上传图像而不会"损坏",这是否需要base64编码/我该如何实现?
2)按名称上传图像(不是"test.jpg")并有一些元数据(例如上传一个带有它所属的标题或部门名称的图像)
迭代1:无指令 这是我的HTML(请注意控制器通过ng-route绑定到页面):
<div class="col-md-12">
<form>
<input type="file" onchange="angular.element(this).scope().filesChanged(this)" data-ng-model="files" multiple>
<button data-ng-click="upload()">Submit</button>
<li data-ng-repeat="file in files">{{file.name}}</li>
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
这是我的控制器:
$scope.filesChanged = function (elm) {
$scope.files = elm.files
$scope.$apply();
}
$scope.upload = function () {
var fd = new FormData()
angular.forEach($scope.files,function(file){
fd.append('file',file)
})
$http.post("/sites/asite/_api/web/lists/getByTitle('Images')/RootFolder/Files/add(url='test.jpg',overwrite='true')", fd,
{
transformRequest: angular.identity,
headers: {
'Content-Type':undefined, 'X-RequestDigest': $("#__REQUESTDIGEST").val()}
}).success(function (d) {
console.log(d);
});
}
Run Code Online (Sandbox Code Playgroud)
更新:我认为这个问题与我的$ http帖子分离到了SharePoint.使用上面提到的指令,我可以输出base64,但不确定如何将其传递到我的帖子中进行上传.
迭代2:使用指令 这是我使用https://github.com/adonespitogo/angular-base64-upload指令的当前HTML :
<form>
<input type="file" data-ng-model="files" …
Run Code Online (Sandbox Code Playgroud) 我们使用Windows更新修补了SharePoint 2013服务器,从那时起我们收到以下错误.我们已重新启动服务器,手动删除了Windows更新,然后重新启动服务器,在Windows更新之前恢复到Windows服务器的副本,但错误仍然存在.我们还从Windows目录中删除了临时文件,没有任何帮助.
Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)
Source Error:
An unhandled exception was generated during the execution of …
Run Code Online (Sandbox Code Playgroud) 我正在寻找关于农场的定义,但我找不到符合我需要的定义.
有谁知道解释它的简单方法?
SharePoint中的Farm是什么?它是如何工作的?
当我在Visual Studio 2012中创建一个简单的SharePoint 2013项目并且我想部署它时,它部署得很好,但是Dll不在全局程序集缓存中.在"高级"选项卡中,我添加了要部署的项目程序集.
在不同的测试中,我将Assembly Deployment Target选项设置为GlobalAssemblyCache,将Include Assembly In Package设置为True,并从第一个场景中描述的包中删除了dll.
Project FW版本是4.5.机器是虚拟机64位,Windows Server 2008.我也试过将项目的平台目标更改为X64和任何CPU而没有运气.
我试图使用gacutil工具手动添加DLL,但它也没有部署.它可能是与4.5框架相关的东西吗?我不能手动部署4.5中的任何Dll,但所有其他工作.
有任何想法吗?谢谢.
当我尝试添加SharePoint mvc应用程序时,我收到以下错误:
Error occurred in deployment step 'Install app for SharePoint':
Failed to install app for SharePoint. Please see the output window for details.
Run Code Online (Sandbox Code Playgroud)
详细的堆栈跟踪:
CorrelationId: 50583239-71cb-4b07-8bcb-4bbc51a22631
ErrorDetail: There was a problem with activating the app web definition.
ErrorType: App
ErrorTypeName: App Related
ExceptionMessage: Microsoft.SharePoint.SPException: Exception from HRESULT: 0x81070964 ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x81070964
at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)
at Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback …
Run Code Online (Sandbox Code Playgroud) 我有一个可视化的Web部件(使用标准的Visual Stuido 2012模板从"添加新项目"表单创建)只有一个<div id="newsListDiv" runat="server"></div>
元素.我想使用以下代码以编程方式将自己的用户控件添加到它:
protected void Page_Load(object sender, EventArgs e)
{
NewsLine newsLine = Page.LoadControl(@"~/_ControlTemplates/MainTheme/NewsLine.ascx") as NewsLine;
newsListDiv.Controls.Add(newsLine);
}
Run Code Online (Sandbox Code Playgroud)
但是当我部署解决方案并将Web部件添加到页面时,它会显示一个错误页面,告诉我文件'/_ControlTemplates/MainTheme/NewsLine.ascx'不存在.但是,如果我查看文件夹"C:\ Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES\MainTheme",我可以看到该文件存在于那里.我试图将信任级别设置为"完全",但得到了相同的错误.我也尝试在.ascx文件中添加用户控件,如下所示:
<%@ Register Src="~/_controltemplates/MainTheme/NewsLine.ascx" TagPrefix="uc1" TagName="NewsLine" %>
<div id="newsListDiv" runat="server">
<uc1:NewsLine runat="server" id="NewsLine" />
</div>
Run Code Online (Sandbox Code Playgroud)
这样就得到了编译错误:"当前上下文中不存在名称'InitializeControl'".我也注意到,只要我将注册或参考行(带有我的用户控件的路径)添加到我的.ascx文件,.g.cs文件就会变成空白!当我删除该行时,它会再次填满.我尝试了许多不同的路径着作,如"../_controltemplates/","/ controltemplates/15 /"等.但它们都没有任何区别.我在这里绝望,请帮忙!
如何获取我的服务器上安装的SharePoint版本?
我正在尝试使用嵌入代码工具向Sharepoint 2013页面添加一些样式.它工作正常,直到我保存页面,然后它删除<style>
和</style>
标签之间的所有文本?
所以我点击页面上的嵌入代码并输入以下内容
<style>
.sampleStyle {color:#fff}
</style>
Run Code Online (Sandbox Code Playgroud)
当它保存并重新打开时,我发现sharepoint已将代码更改为此
<style unselectable="on">
</style>
Run Code Online (Sandbox Code Playgroud) 目前我有代码Documents
在运行时在目录中创建一个文件夹:
using (var context = new Microsoft.SharePoint.Client.ClientContext(sharePointSite))
{
context.Credentials = new Microsoft.SharePoint.Client.SharePointOnlineCredentials(user, password);
Web web = context.Web;
Microsoft.SharePoint.Client.List docs = web.Lists.GetByTitle(<upper level folder>);
docs.EnableFolderCreation = true;
docs.RootFolder.Folders.Add(folderName);
context.ExecuteQuery();
return true;
}
Run Code Online (Sandbox Code Playgroud)
我在使用此代码创建的文件夹中创建子文件夹时遇到了麻烦.因此,如果我想创建一个名为Feb
under Documents
this 的文件夹就可以了.但是,如果我想创建一个Week 2
在新文件夹下调用的文件夹Feb
.它不会那样做.我收到此错误:
{"List 'Feb' does not exist at site with URL 'https://my.sharepoint.com/sites/labels'."}
我意识到问题可能是docs.RootFolder.Folders.Add(folderName);
因为它Feb
不是根文件夹,当它查找它时会抛出异常.
所以我希望有人可以帮我解决一些代码,将子文件夹添加到已创建的文件夹中.我使用Visual Stuidos 2010并且无法升级到2012,否则我会.我有Microsoft.Sharepoint.Client
可以在VS 2010中引用的2013 dll.
我有指向sharepoint 2013 Office 365的Web服务.我使用客户端对象模型.我正在尝试更新存储4个附件的xml文件.当我在xml文件中有大量二进制数据时执行此操作时,出现以下错误:
信息
请求消息太大了.服务器不允许大于2097152字节的消息.
我意识到我可能不得不分离xml文件中的附件,但目前我的infopath表单将它们存储在那里.有没有办法可以增加请求长度或者可以节省大量的东西.我真的只是修改一个节点,除非我更新xml,否则它将无法工作.谢谢 .代码如下.
我的代码:
ListItem docReq = GetDocRequestLight(docRequestID, businessID);
string fPath = (string)docReq["FileRef"];
using (FileInformation fInfo = Microsoft.SharePoint.Client.File.OpenBinaryDirect(ctx, fPath))
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(fInfo.Stream);
XmlNamespaceManager xmlNameSpaceMgr = new XmlNamespaceManager(xmlDoc.NameTable);
xmlNameSpaceMgr.AddNamespace("my", DocReqXmlNameSpace);
// Get Parent Node
XmlNode node = xmlDoc.SelectSingleNode(GetXPathFromItemKey(velmaKey), xmlNameSpaceMgr);
DateTime outDate;
bool outBool;
if (DateTime.TryParse(newValue, out outDate))
node.InnerText = outDate.ToString("yyyy-MM-dd");
if (Boolean.TryParse(newValue, out outBool))
node.InnerText = newValue;
// Update Statuses
XmlNode statusIDNode = xmlDoc.SelectSingleNode(DocReqStatusIDFieldXPath, xmlNameSpaceMgr);
statusIDNode.InnerText = updatedStatus.ID.ToString();
XmlNode statusNode = xmlDoc.SelectSingleNode(DocReqStatusFieldXPath, …
Run Code Online (Sandbox Code Playgroud) sharepoint-2013 ×10
sharepoint ×8
csom ×2
.net-4.5 ×1
angularjs ×1
c# ×1
css ×1
deployment ×1
image ×1
javascript ×1
version ×1
web-parts ×1