VideoSet.UploadVideo method
Uploads the video file with the specified file name to the specified list.
Namespace: Microsoft.Office.DocumentManagement.VideoSets
Assembly: Microsoft.Office.DocumentManagement (in Microsoft.Office.DocumentManagement.dll)
Syntax
'Declaration
Public Shared Function UploadVideo ( _
list As SPList, _
fileName As String, _
file As Stream, _
overwriteIfExists As Boolean, _
parentFolderPath As String _
) As String
'Usage
Dim list As SPList
Dim fileName As String
Dim file As Stream
Dim overwriteIfExists As Boolean
Dim parentFolderPath As String
Dim returnValue As String
returnValue = VideoSet.UploadVideo(list, _
fileName, file, overwriteIfExists, _
parentFolderPath)
public static string UploadVideo(
SPList list,
string fileName,
Stream file,
bool overwriteIfExists,
string parentFolderPath
)
Parameters
list
Type: Microsoft.SharePoint.SPListList to upload the file to.
fileName
Type: System.StringName of the file, including the extension.
file
Type: System.IO.StreamFile stream to be uploaded.
overwriteIfExists
Type: System.BooleanOverwrites the existing file, if true. If false, the existing file will not be updated.
parentFolderPath
Type: System.StringOptional server-relative folder URL for the folder within the list to upload the file to. If null, file will be uploaded to the root folder.
Return value
Type: System.String
Absolute URL of the uploaded video file.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The videoPath parameter is a null reference (Nothing in Visual Basic). |
ArgumentNullException | Video cannot be found at the specified path. |
Remarks
In order to get the full video experience, the video file should be uploaded to the document library that contains the video content type.