A group of methods for creating and modifying object files.
AddEmptyFile | Adds an empty file to an existing object. |
AddFile | Adds a new file to the specified object based on the given path. |
CancelFileDownloadSession | Stops the specified file download. |
CloseUploadSession | Closes the upload session. |
ConvertToPDF | Converts the specified object file to PDF format. |
DownloadFile | Downloads the content of the specified file from the server to the specified path. |
DownloadFileAsDataURI | Downloads the content of the specified file as a data URI. |
DownloadFileAsDataURIEx | Downloads the content of the specified file as a data URI. |
DownloadFileEx | Downloads the content of the specified file from the server to the specified path. |
DownloadFileEx2 | Downloads the content of the specified file from the server to the specified path. |
DownloadFileEx3 | Downloads the content of the specified file from the server to the specified path. |
DownloadFileInBlocks_Begin | Begins the block-by-block download of the specified file. |
DownloadFileInBlocks_Begin_32bit | Begins the block-by-block download of the specified file (uses 32-bit arguments). |
DownloadFileInBlocks_Begin_32bitEx | Begins the block-by-block download of the specified file (using 32-bit arguments). |
DownloadFileInBlocks_BeginEx | Begins the block-by-block download of the specified file. |
DownloadFileInBlocks_BeginEx_32bit | Begins the block-by-block download of the specified file (uses 32-bit arguments). |
DownloadFileInBlocks_BeginEx_32bitEx | Begins the block-by-block download of the specified file (using 32-bit arguments). |
DownloadFileInBlocks_BeginEx2 | Begins the block-by-block download of the specified file. |
DownloadFileInBlocks_BeginEx3 | Begins the block-by-block download of the specified file. |
DownloadFileInBlocks_ReadBlock | Retrieves a specific block of the specified file from the server. |
DownloadFileInBlocks_ReadBlock_32bit | Retrieves a specific block of the specified file from the server (uses 32-bit arguments). |
FindEmailDuplicates | Searches the vault for duplicate emails based on the given message ID. |
FindFileDuplicates | Locates the first 100 duplicates of a specified file version in the vault as a list of ObjIDs. |
FindFileDuplicatesBasedOnPath | Searches the vault for duplicates of a file based on the given path as a list of ObjIDs. |
FindFileDuplicatesOfObjVer | Locates the first 100 duplicates of a specified obj version in the vault as a list of ObjIDs. |
FindFilesByChecksumWithNumericalDigests | Uses a numerical digest to search the vault for file versions with a matching MD5 checksum. |
FindFilesByChecksumWithStringDigests | Uses a string digest to search the vault for file versions with a matching MD5 checksum. |
FindVaultDuplicates | Finds all of the duplicates in the vault. |
GetFiles | Gets all object files of the specified object. |
GetFilesForModificationInEventHandler | Gets all object files of the specified object for modification in event handler. |
GetFileSize | Gets the size of the specified file. |
GetFileSize_32bit | Gets the size of the specified file. |
GetFileSize_32bitEx | Gets the size of the specified file (using 32-bit arguments). |
GetFileSizeEx | Gets the size of the specified file. |
GetLatestFileVersion | Gets the latest version of the specified file. |
GetObjIDOfFile | Retrieves the object of the file. |
GetPathInDefaultView | Gets the path of the file in the ID view. |
GetPathInDefaultViewEx | Gets the path to the file either in the ID view or a traditional folder. |
GetPathInDefaultViewEx2 | Gets the path of the file in the ID view. |
GetPathInDefaultViewEx3 | Gets the path to the file either in the ID view or in a traditional folder. |
GetTextContentForFile | Gets the plain text content of a file in the vault. |
GetTextContentForFileEx | Gets the plain text content of a file in the vault. |
GetTextContentForTemporaryFile | Gets the plain text content of a temporary file. |
HasFileDuplicates | Checks if duplicates of a file exist. |
OpenFileInDefaultApplication | Opens the given object file in the default application as specified. |
PerformOCROperation | Performs an optical character recognition operation for object file. |
RemoveFile | Deletes the specified file from the specified object. |
RenameFile | Renames the given file. |
UpdateMetadataInFile | Updates metadata embedded in the specified file. |
UploadFile | Uploads the new content of the specified file to the server. |
UploadFileBlock | Uploads a block of the specified file. |
UploadFileBlock_32bit | Uploads a block of the specified file (uses 32-bit arguments). |
UploadFileBlockBegin | Begins uploading a file to the server. |
UploadFileBlockBegin_32bit | Begins uploading a file to the server (uses 32-bit arguments). |
UploadFileCommit | Commits the upload operation of the specified file. |
UploadFileCommit_32bit | Commits the upload operation of the specified file (uses 32-bit arguments). |
UploadFileCommit_32bitEx | Commits the upload operation of the specified file (using 32-bit arguments). |
UploadFileCommitEx | Commits the upload operation of the specified file. |
UploadFileEx | Uploads the new content of the specified file to the server. |
UploadFromDataURI | Uploads new content for the specified document file from the specified data URI. |
UploadFromDataURIEx | Uploads new content for the specified document file from the specified data URI. |
UploadTemporaryFile | Uploads the specified file as a temporary file to the server. |
UploadTemporaryFileBlock | Uploads a block of the specified temporary file. |
UploadTemporaryFileBlock_32bit | Uploads a block of the specified temporary file (using 32-bit arguments). |
UploadTemporaryFileBlockBegin | Begins uploading a temporary file to the server. |
UploadTemporaryFileBlockBegin_32bit | Begins uploading a temporary file to the server (using 32-bit arguments). |
UploadTemporaryFileCommit | Commits the upload operation of the specified temporary file. |
UploadTemporaryFileCommit_32bit | Commits the upload operation of the specified temporary file (using 32-bit arguments). |
' Initialize the API and connect to a vault. Dim oVault As MFilesAPI.Vault ' ... ' We are searching for the document with ID 123. Dim iDocumentId As Integer iDocumentId = 123 ' Initialize an ObjID object for the search. Dim oObjId As New MFilesAPI.ObjID oObjId.SetIDs(MFilesAPI.MFBuiltInObjectType.MFBuiltInObjectTypeDocument, iDocumentId) ' Invoke the search operation. Dim oObjectVersion As MFilesAPI.ObjectVersion Dim oObjectVersionAndProperties As MFilesAPI.ObjectVersionAndProperties oObjectVersionAndProperties = oVault.ObjectOperations.GetLatestObjectVersionAndProperties(oObjId, True) oObjectVersion = oObjectVersionAndProperties.VersionData ' Download all the files of the object. Dim oObjectFiles As MFilesAPI.ObjectFiles = oObjectVersion.Files For Each oObjectFile As MFilesAPI.ObjectFile In oObjectFiles ' Construct the target path for downloading the file. Dim szTargetPath = "C:\MyWorkFiles\" + oObjectFile.GetNameForFileSystem() ' Output the title and the extension of the object file. Call Console.WriteLine("Downloading '" + szTargetPath + "'") oVault.ObjectFileOperations.DownloadFile(oObjectFile.ID, oObjectFile.Version, szTargetPath) Next ' Play around with the files here. ' ... ' Start uploading the files back to M-Files. Dim oObjectVersionCheckedOut As MFilesAPI.ObjectVersion ' This object is not yet checked out for the current user, so try to check it out. oObjectVersionCheckedOut = oVault.ObjectOperations.CheckOut(oObjId) ' Upload all the files of the object. Dim oObjectFiles2 As MFilesAPI.ObjectFiles = oVault.ObjectFileOperations.GetFiles(oObjectVersionCheckedOut.ObjVer) For Each oObjectFile As MFilesAPI.ObjectFile In oObjectFiles2 ' Construct the source path for uploading the file. Dim szSourcePath = "C:\MyWorkFiles\" + oObjectFile.GetNameForFileSystem() ' Output the title and the extension of the object file. Call Console.WriteLine("Uploading '" + szSourcePath + "'") oVault.ObjectFileOperations.UploadFile(oObjectFile.ID, oObjectFile.Version, szSourcePath) Next ' Finally, we must check in the changes. oVault.ObjectOperations.CheckIn(oObjectVersionCheckedOut.ObjVer)
' Initialize the API and connect to a vault. Dim oVault As MFilesAPI.Vault ' ... ' We are searching for the document with ID 123. Dim iDocumentId As Integer iDocumentId = 123 ' Initialize an ObjID object for the search. Dim oObjId As New MFilesAPI.ObjID oObjId.SetIDs(MFilesAPI.MFBuiltInObjectType.MFBuiltInObjectTypeDocument, iDocumentId) ' Invoke the search operation. Dim oObjectVersionCheckedOut As MFilesAPI.ObjectVersion Dim oObjectVersionAndProperties As MFilesAPI.ObjectVersionAndProperties oObjectVersionAndProperties = oVault.ObjectOperations.GetLatestObjectVersionAndProperties(oObjId, True) oObjectVersionCheckedOut = oObjectVersionAndProperties.VersionData ' Get the info for all the versions of this document. Dim oObjectVersions As MFilesAPI.ObjectVersions oObjectVersions = oVault.ObjectOperations.GetHistory(oObjId) ' Check if this object version is checked out to the current user. If oObjectVersionCheckedOut.ThisVersionCheckedOut Then Call Console.WriteLine("Document object: '" + oObjectVersionCheckedOut.GetNameForFileSystem() + "' [checked out to me]") Call Console.WriteLine(" Current version: " + CStr(oObjectVersionCheckedOut.ObjVer.Version)) Call Console.WriteLine(" Checked out: " + oObjectVersionCheckedOut.CheckedOutAtUtc + " UTC") ' Try to resolve the previous version number before checkout. If oObjectVersions.Count > 1 Then Dim oObjectVersionOld As MFilesAPI.ObjectVersion = oObjectVersions.Item(oObjectVersions.Count - 1) Call Console.WriteLine(" Latest version before checkout identified by: " + CStr(oObjectVersionOld.ObjVer.Version)) End If Else Call Console.WriteLine("Document object: '" + oObjectVersionCheckedOut.GetNameForFileSystem() + "'") End If ' Resolve the last modification timestamp of the object. Dim dtObjectModification As Date = oObjectVersionCheckedOut.LastModifiedUtc Call Console.WriteLine(" Object modified: " + CStr(dtObjectModification) + " UTC") ' Process the object files. Dim oObjectFiles As MFilesAPI.ObjectFiles = oObjectVersionCheckedOut.Files For Each oObjectFile As MFilesAPI.ObjectFile In oObjectFiles ' Construct the FileVer string for the file. Dim szFileVer = CStr(oObjectFile.ID) + "-" + CStr(oObjectFile.Version) ' Output the identification of the object file. Call Console.WriteLine(" Document file: '" + oObjectFile.GetNameForFileSystem() + "'") ' Resolve the last modification timestamp of the file content. Dim dtContentModification As Date = oObjectFile.LastAccessTimeUtc Call Console.WriteLine(" Currently identified by: " + szFileVer) ' Try to find the previous versions of the object files. If oObjectVersionCheckedOut.ThisVersionCheckedOut And oObjectVersions.Count > 1 Then Dim oObjectFilesOld As MFilesAPI.ObjectFiles = oObjectVersions.Item(oObjectVersions.Count - 1).Files For Each oObjectFileOld As MFilesAPI.ObjectFile In oObjectFilesOld If oObjectFileOld.ID = oObjectFile.ID Then ' Construct the FileVer string for the previous version of the file. Dim szFileVerOld = CStr(oObjectFileOld.ID) + "-" + CStr(oObjectFileOld.Version) Call Console.WriteLine(" Latest version before checkout identified by: " + szFileVerOld) Call Console.WriteLine(" File content modified: " + CStr(dtContentModification) + " UTC") End If Next End If Next