You can upload files to Anaplan, split large upload files into chunks, download export files in chunks, and delete private file content that you uploaded through the API.
Chunking is useful for large files because it helps make uploads and downloads more resilient.
When to use chunking
Use chunking when:
- You want to resume a transfer if the connection is lost during an upload.
- You are extracting data from a database and want to push it to the server without holding all the results in memory.
- You need to upload a file larger than 1 MB.
- You need to download an exported file in multiple parts.
File metadata
The file list endpoint returns import and export files for a model. You can identify files by their metadata and id.
File metadata can include:
| Property | Description |
id | The file ID. |
name | The file name. |
chunkCount | The number of chunks in the file. |
delimiter | The delimiter character used in the file. |
encoding | The file encoding. |
firstDataRow | The first row after the row that contains column names. |
format | The file format. |
headerRow | The row that contains column names. |
separator | The file separator. |
Export files have fewer metadata properties than import files.
Related workflows
Chunked file transfer is often part of a larger integration workflow.
For imports:
- Upload the file or file chunks.
- Mark the upload complete.
- Start the import task.
- Poll the import task until it completes.
- Check or download dump files if the import has failures.
For exports:
- Start the export task.
- Poll the export task until it completes.
- Get the export file.
- Get the chunks in the file.
- Download each chunk.
You can see an example of a chunked file upload process, here.