Uploads the new content of the specified file to the server.
Visual Basic |
---|
Public Sub UploadFile( _ ByVal File As Long, _ ByVal FileVersion As Long, _ ByVal FilePath As String _ ) |
' Identify the target document. Dim oObjID As New MFilesAPI.ObjID '... ' Check out the target document. Dim oCheckedOutVersion As MFilesAPI.ObjectVersion oCheckedOutVersion = oVault.ObjectOperations.CheckOut(oObjID) ' Determine the target file to be uploaded. Dim oCheckedOutFiles As MFilesAPI.ObjectFiles Dim oCheckedOutFile As MFilesAPI.ObjectFile oCheckedOutFiles = oVault.ObjectFileOperations.GetFiles(oCheckedOutVersion.ObjVer) oCheckedOutFile = oCheckedOutFiles.Item(1) ' Upload the file. Dim szFile As String = "C:\Temp\File.pdf" oVault.ObjectFileOperations.UploadFile(oCheckedOutFile.ID, oCheckedOutFile.FileVer.Version, szFile) ' Finalize with check-in. oVault.ObjectOperations.CheckIn(oCheckedOutVersion.ObjVer)