Interface IFileManagerService - WS API
Interface IFileManagerService - WS API
Interface IFileManagerService
This interface has operations for file management (upload and download).
Syntax
Remarks
Certain memoQ Server web service operations (such as IServerProjectService.ImportTranslationDocument for
document import) require a file to be uploaded. IFileManagerInterface.BeginChunkedFileUpload and its
related operations can be used to upload the file first, and then the file identifier returned by
BeginChunkedFileUpload can be used to identify the uploaded file to be imported when calling
IServerProjectServicedocument.ImportTranslationDocument.
Methods
AddNextFileChunk(Guid, Byte[])
Performs the upload of the next file chunk. The operation should be called in turns to upload the next chunk
of the file. It is important that the interval between two AddNextFileChunk calls (and the interval between the
call of BeginChunkedFileUpload and the first call of AddNextFileChunk) is less than a minute or two. If the
interval is larger, then the upload session times out on the server and reserved resources (such as the file
handle) are released, the upload cannot continue.
Declaration
Parameters
Guid fileIdAndSessionId The session id (guid) of the chunked file upload session
(https://learn.microsoft.com/ created by BeginChunkedFileUpload.
dotnet/api/system.guid)
https://docs.memoq.com/current/api-docs/wsapi/api/filemanagerservice/MemoQServices.IFileManagerService.html 1/6
9/12/24, 1:04 PM Interface IFileManagerService | WS API
Exceptions
Type Condition
GenericFault The details within the fault identify the specific error. Thrown for
(MemoQServices.GenericFault.htm expected business errors that have no specific faults.
l)
Declaration
Guid BeginChunkedFileDownload(Guid fileGuid, bool zip, out string fileName, out int fileSiz
e)
Parameters
Type Name Description
String fileName Name or path of the file (output parameter). It's exact
(https://learn.microsoft.com/dotn content depends on the operation that has created the file.
et/api/system.string)
Returns
Type Description
Guid The session id (guid) of the newly started chunked file download session. It
(https://learn.microsoft. should be provided as first parameter for the GetNextFileChunk and
com/dotnet/api/system EndChunkedFileDownload operations.
.guid)
https://docs.memoq.com/current/api-docs/wsapi/api/filemanagerservice/MemoQServices.IFileManagerService.html 2/6
9/12/24, 1:04 PM Interface IFileManagerService | WS API
Exceptions
Type Condition
GenericFault The details within the fault identify the specific error. Thrown for
(MemoQServices.GenericFault.htm expected business errors that have no specific faults.
l)
BeginChunkedFileUpload(String, Boolean)
Starts a new chunked file upload session.
Declaration
Parameters
String fileName Name or path of the file. This information is stored with the uploaded
(https://learn.microsoft.c file. It can contain only characters that are valid on a Windows
om/dotnet/api/system.st Operating System (e.g. '?', '' are not allowed).
ring)
Boolean isZipped If set to true, the file is assumed to be a zipped file, therefore it is
(https://learn.microsoft.c unzipped on the server after upload.
om/dotnet/api/system.b
oolean)
Returns
Type Description
Guid The session id (guid) of the newly started chunked file upload session. It should be
(https://learn.mi provided as first parameter for the AddNextFileChunk and EndChunkedFileUpload. This
crosoft.com/dot guid is also the file identifier, that can be used by other web service operations after the
net/api/system. file upload session has been ended by calling EndChunkedFileUpload.
guid)
Exceptions
Type Condition
GenericFault The details within the fault identify the specific error. Thrown for
(MemoQServices.GenericFault.htm expected business errors that have no specific faults.
l)
https://docs.memoq.com/current/api-docs/wsapi/api/filemanagerservice/MemoQServices.IFileManagerService.html 3/6
9/12/24, 1:04 PM Interface IFileManagerService | WS API
DeleteFile(Guid)
Deletes the file on the memoQ Server. Call to delete uploaded and server generated files as soon as possible
if they are no longer needed.
Declaration
Parameters
Exceptions
Type Condition
GenericFault The details within the fault identify the specific error. Thrown for
(MemoQServices.GenericFault.htm expected business errors that have no specific faults.
l)
EndChunkedFileDownload(Guid)
Call to end the chunked file download session after downloading all file bytes by GetNextFileChunk. It is very
important to call this method as soon as possible after downloading the last chunk of data to release server
resources (such as the file handle).
Declaration
Parameters
Guid sessionId The session id (guid) of the chunked file download session
(https://learn.microsoft.com/do created by BeginChunkedFileDownload.
tnet/api/system.guid)
Exceptions
Type Condition
GenericFault The details within the fault identify the specific error. Thrown for
(MemoQServices.GenericFault.htm expected business errors that have no specific faults.
l)
https://docs.memoq.com/current/api-docs/wsapi/api/filemanagerservice/MemoQServices.IFileManagerService.html 4/6
9/12/24, 1:04 PM Interface IFileManagerService | WS API
EndChunkedFileUpload(Guid)
Ends the chunked file upload session. Call to indicate to the memoQ Server that all chunks have been sent by
calling AddNextFileChunk. It is very important to call this method as soon as possible after uploading the last
chunk of data to release server resources (such as the file handle). If the uploaded file is zipped, then the
unzipping is performed, and the function does not return until the unzipping of the file has finished.
Declaration
Parameters
Type Name Description
Guid fileIdAndSessionId The session id (guid) of the chunked file upload session
(https://learn.microsoft.com/ created by BeginChunkedFileUpload.
dotnet/api/system.guid)
Exceptions
Type Condition
GenericFault The details within the fault identify the specific error. Thrown for
(MemoQServices.GenericFault.htm expected business errors that have no specific faults.
l)
GetNextFileChunk(Guid, Int32)
Performs the download of the next file chunk. The operation should be called in turns to download the next
chunk of the file. It is important that the interval between two GetNextFileChunk calls (and the interval
between the call of BeginChunkedFileDownload and the first call of GetNextFileChunk) is less than a minute
or two. If the interval is larger, then the download session times out on the server and reserved resources
(such as the file handle) are released, the download can not continue.
Declaration
Parameters
Guid sessionId The session id (guid) of the chunked file download session created by
(https://learn.micro BeginChunkedFileDownload.
soft.com/dotnet/ap
i/system.guid)
Int32 byteCount The number of bytes to be returned. The actual number of bytes may be
(https://learn.micro less then this if the amount of remaining file data is less. Therefore always
soft.com/dotnet/ap check the number of bytes of the returned data.
i/system.int32)
https://docs.memoq.com/current/api-docs/wsapi/api/filemanagerservice/MemoQServices.IFileManagerService.html 5/6
9/12/24, 1:04 PM Interface IFileManagerService | WS API
Returns
Type Description
Byte The file data requested. The actual number of bytes may be less then the
(https://learn.microsoft.com/do requested amount if the amount of remaining file data is less.
tnet/api/system.byte)
[]
Exceptions
Type Condition
GenericFault The details within the fault identify the specific error. Thrown for
(MemoQServices.GenericFault.htm expected business errors that have no specific faults.
l)
https://docs.memoq.com/current/api-docs/wsapi/api/filemanagerservice/MemoQServices.IFileManagerService.html 6/6