I want to upload a word document to sharepoint document library using javascript (say for ex .Net site).
How can i achieve this?
I want to upload a word document to sharepoint document library using javascript (say for ex .Net site). How can i achieve this? |
|||||||||||||||||||||
|
SharePoint 2013 provides a new client object model that enables you to create SharePoint solutions that run remotely from the SharePoint server farm. For example, the client object model enables you to consume and manipulate SharePoint data in Windows Forms applications, WPF application, console applications, Silverlight applications, and ASP.NET Web applications. What you will need to do to achieve this is make references to the Sharepoint client object model libraries namely Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll from within your asp.net project. Connecting remotely to the Sharepoint site will be achieved through SPClientContext
Uploading the file remotely will use the SaveBinaryDirect() method of File object
See more at: http://www.ecanarys.com/blog-entry/how-upload-documents-sharepoint-2013 |
|||
|
It's still quite uncomfortable to upload documents by using the JSOM API. But it's possible. In your case your Word file must be not larger than 1.5 MB. Additionally the clients browser must support HTML5. Here is a code example (it references also the jQuery library):
When you work with larger files you must use the REST API following by MSDN. |
|||
|