0% found this document useful (0 votes)
6 views

Interface IFileManagerService - WS API

ws DOCUMENTATION

Uploaded by

Pablo Estrada
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Interface IFileManagerService - WS API

ws DOCUMENTATION

Uploaded by

Pablo Estrada
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

9/12/24, 1:04 PM Interface IFileManagerService | WS API

Interface IFileManagerService
This interface has operations for file management (upload and download).

Syntax

public interface IFileManagerService

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.

There are other memoQ Server web service operations (such as


IServerProjectServicedocument.ExportTranslationDocument for document export) that store the result on the
memoQ Server in a file. The file identifier returned by these operations can be used to download the file
using IFileManagerInterface.BeginChunkedFileDownload and its related operations.

Uploaded files and files created by web service operations (such as


IServerProjectServicedocument.ExportTranslationDocument are not preserved for more than a few hours in
the memoQ Server. Therefore, initiate processing operations (such as document import) immediately after
file upload. It is also recommended to delete the uploaded file by calling DeleteFile if a file is no longer
needed. For example after the processing (such as document import) has finished, and also after having
downloaded the resulting file of a server operation (such as document export).

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

void AddNextFileChunk(Guid fileIdAndSessionId, byte[] fileData)

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)

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

Type Name Description

Byte fileData The bytes of the file chunk.


(https://learn.microsoft.com/
dotnet/api/system.byte)
[]

Exceptions

Type Condition

UnexpectedFault An unexpected error occured; equivalent of an 501 'Internal server


(MemoQServices.UnexpectedFault error' http result.
.html)

GenericFault The details within the fault identify the specific error. Thrown for
(MemoQServices.GenericFault.htm expected business errors that have no specific faults.
l)

BeginChunkedFileDownload(Guid, Boolean, out String, out Int32)


Starts a new chunked file download session.

Declaration

Guid BeginChunkedFileDownload(Guid fileGuid, bool zip, out string fileName, out int fileSiz
e)

Parameters
Type Name Description

Guid fileGuid The file identifier.


(https://learn.microsoft.com/dotn
et/api/system.guid)

Boolean zip This parameter is deprecated, the value will be ignored.


(https://learn.microsoft.com/dotn
et/api/system.boolean)

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)

Int32 fileSize Size of the file in bytes (output parameter).


(https://learn.microsoft.com/dotn
et/api/system.int32)

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

UnexpectedFault An unexpected error occured; equivalent of an 501 'Internal server


(MemoQServices.UnexpectedFault error' http result.
.html)

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

Guid BeginChunkedFileUpload(string fileName, bool isZipped)

Parameters

Type Name Description

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

UnexpectedFault An unexpected error occured; equivalent of an 501 'Internal server


(MemoQServices.UnexpectedFault error' http result.
.html)

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

void DeleteFile(Guid fileGuid)

Parameters

Type Name Description

Guid (https://learn.microsoft.com/dotnet/api/system.guid) fileGuid The identifier of the file to be deleted.

Exceptions

Type Condition

UnexpectedFault An unexpected error occured; equivalent of an 501 'Internal server


(MemoQServices.UnexpectedFault error' http result.
.html)

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

void EndChunkedFileDownload(Guid sessionId)

Parameters

Type Name Description

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

UnexpectedFault An unexpected error occured; equivalent of an 501 'Internal server


(MemoQServices.UnexpectedFault error' http result.
.html)

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

void EndChunkedFileUpload(Guid fileIdAndSessionId)

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

UnexpectedFault An unexpected error occured; equivalent of an 501 'Internal server


(MemoQServices.UnexpectedFault error' http result.
.html)

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

byte[] GetNextFileChunk(Guid sessionId, int byteCount)

Parameters

Type Name Description

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

UnexpectedFault An unexpected error occured; equivalent of an 501 'Internal server


(MemoQServices.UnexpectedFault error' http result.
.html)

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

You might also like