Title
Create new category
Edit page index title
Edit category
Edit link
How to upload chunked files in MFT using Powershell and REST API
Overview
This article explains how to upload files to OPSWAT MetaDefender Managed File Transfer using PowerShell and the REST API with chunked upload.
It covers:
Authentication
Transfer group creation
File initialization
Chunked upload
Transfer finalization
✅ Prerequisites
Access to MetaDefender MFT API endpoint
Valid username and password
PowerShell 5.1+ or PowerShell 7+
Network access to:
📂 File Preparation
Ensure the file exists locally:
🔐 Credentials File Format
Create a file named:
With content:
🔄 Workflow Summary
The upload process follows this sequence:
Authenticate → token
Create transfer group →
group_idInitialize file →
file_idUpload file in chunks
Close file transfer
Close group transfer
💻 PowerShell Script
(Place your cleaned-up version here — remove debug clutter and fix issues before publishing)
👉 Important: Include only:
final working version
comments explaining each step
⚙️ Key Configuration Parameters
Parameter | Description |
|---|---|
| API base endpoint |
| Chunk size (default: 10MB) |
| Stream or Chunk |
| Byte position for each chunk |
📦 Chunk Upload Logic Explained
File is read in fixed-size buffers
Each chunk is sent with:
file_idgroup_idchunk_offset
Offset increases after each upload
This prevents:
Memory issues
File corruption
Large upload failures
✅ Validation
After execution, you should see:
❗ Troubleshooting
🔴 Authentication fails
Verify credentials format
Confirm encoding method (CRLF vs
username:password)
🔴 File transfer fails on close
Check
file_checksumEnsure hash matches server expectation:
🔴 Chunk upload errors
Verify:
chunk_offsetcorrectnesschunk size (try reducing to 4MB)
Check network stability
🔴 File corruption
Ensure buffer is trimmed:
🔐 Security Considerations
Do not store plaintext passwords in production
Use:
Windows Credential Manager
Secure vault solutions
Always use HTTPS
🚀 Best Practices
Use retry logic for chunk uploads
Log all API responses
Validate checksum after upload
Tune chunk size based on network
Download: MFT-chunkupload
Support
If Further Assistance is required, please proceed to log a support case or chat with one of our support engineers.