Comments (2)
Test with CSOM and http://mysharepointlearnings.wordpress.com/2014/06/30/provider-hosted-app-upload-large-files-using-csom/
https://gist.github.com/garima2510/b1167e611ffb495848ec#file-uploadfilelarge-cs
var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext, SPHostUrl);
using (var clientContext = spContext.CreateUserClientContextForSPAppWeb())
{
if (clientContext != null)
{
//file is uploaded file. Could be read from Request.Files
using (FileStream fs = new FileStream(file.FileName, FileMode.Open))
{
//code for file size > 2MB. tested upto 50MB
FileCreationInformation newFile = new FileCreationInformation();
newFile.ContentStream = fs;
newFile.Url = Path.GetFileName(file.FileName);
newFile.Overwrite = true;
List docs = clientContext.Web.Lists.GetByTitle("List_Name");
Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(newFile);
clientContext.Load(uploadFile);
clientContext.ExecuteQuery();
}
}
}
from spmeta2.
Covered with SPMeta2.Regression.Tests.Impl.Scenarios.ModuleFileScenariousTest implementation for 1, 5, 15, 25 and 50Mb generated files.
from spmeta2.
Related Issues (20)
- WebpartModelHandler null reference exception HOT 2
- Unblock regression testing for 1.2.150-beta1 HOT 1
- SPMeta2.CSOM v16 (Foundation) use O365 CSOM not SP2016 CSOM!
- SPMeta deprecated HOT 5
- Create child TaxonomyTermDefinition HOT 6
- Issue with provisioning Publishing PageLayouts HOT 3
- Could not load file or assembly 'Microsoft.SharePoint.Client, Version=15.0.0.0 HOT 3
- SPMeta2.Exceptions.SPMeta2ModelDeploymentException : Field or property "vti_iplabelid" does not exist. HOT 2
- ModuleFileDefinition misses ParentHostCapability
- TaxonomyTermGroupDefinition misses [ExpectRequired] for Name property
- Site collection creation via CSOM HOT 1
- XsltListViewWebPartDefinition ParameterBinding Deployment leads to wrong markup HOT 1
- Workflow get not deployed to Content Type HOT 2
- Set up Form JSLink
- Custom User Profile property provision
- Additional columns from lookup field
- O365 CSOM - AuthorizationFilter is not working.
- navigation nodes on child web client context are provisioned on root site instead
- wrong message when deploying the field and the name is too long
- cant deploy item display templates to the office 365
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spmeta2.