Skip to main content

FileColumnTransferHelper

  • Namespace: PPDS.Migration.Import
  • Assembly: PPDS.Migration
  • Kind: Class

Summary

Handles chunked upload/download of file column binary data. Uses 4MB (4,194,304 byte) chunks per Dataverse SDK limit.

Members

Constructors

FileColumnTransferHelper(IDataverseConnectionPool connectionPool)

FileColumnTransferHelper(IDataverseConnectionPool connectionPool)

Initializes a new instance of the PPDS.Migration.Import.FileColumnTransferHelper class.

  • Param connectionPool: The connection pool.

Methods

DownloadAsync

Task<byte[]> DownloadAsync(string entityName, Guid recordId, string fieldName, CancellationToken cancellationToken)

Downloads file column data in chunks.

  • Param entityName: The logical name of the entity.

  • Param recordId: The record identifier.

  • Param fieldName: The file column attribute name.

  • Param cancellationToken: Cancellation token.

  • Returns: The complete file data as a byte array.

UploadAsync

Task UploadAsync(string entityName, Guid recordId, string fieldName, byte[] data, string fileName, string mimeType, CancellationToken cancellationToken)

Uploads file column data in 4MB chunks. AC-35. Uses InitializeFileBlocksUploadRequest -> UploadBlockRequest -> CommitFileBlocksUploadRequest.

  • Param entityName: The logical name of the entity.

  • Param recordId: The record identifier.

  • Param fieldName: The file column attribute name.

  • Param data: The file data to upload.

  • Param fileName: The original file name.

  • Param mimeType: The MIME type of the file.

  • Param cancellationToken: Cancellation token.