0

I am making a app for SharePoint and have a form with several inputs for text and for files as well. The input for files works fine for regular files such as Word, Excel, PowerPoint, images etc... but wont work with videos. Is it possible to upload a video to a document library by code? Or cant you do that simply because the files is usually to big and would take long to upload?

The files is of the type HttpPostedFileBase and sent by a normal mvc form.

And this is the code for uploading it to the folder

FileCreationInformation attachFileInfo = new FileCreationInformation();
attachFileInfo.ContentStream = pNewRequest.FileToUpload1.InputStream;
attachFileInfo.Url = Path.GetFileName(pNewRequest.FileToUpload1.FileName);
newFolder.Files.Add(attachFileInfo);
0

On this page there's a comprehensive list on methods to upload files to SharePoint online using CSOM: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-large-files-sample-app-for-sharepoint

It show guidance on when to use a certain method.

0

If the video file is very large, then it is recommended to upload via "StartUpload","ContinueUpload","FinishUpload" with chunkedfiles to achieve:

Large file upload in SharePoint Online with CSOM PowerShell

SharePoint Online/2016/2013 - How To Upload Large Files Using PowerShell Automation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.