Skip to main content
The media manager is responsible for managing multimedia resources such as files, images, videos, and audio in messages, including upload and download operations.
Files, images, videos, audio and other multimedia resources in messages are all managed through the media manager
This documentation only covers core methods. For more details, check the [WKSDK shared].mediaManager interface in the code.

Custom Upload

Create Upload Task

Inherit from WKMessageFileUploadTask and implement necessary methods:

Implement Upload Task

Register Upload Task

Custom Download

Create Download Task

Register Download Task

Progress Management

Monitor Upload Progress

Monitor Download Progress

File Management

Get File Path

Clear Cache

Best Practices

  1. Progress Feedback: Always provide progress feedback for long-running operations
  2. Error Handling: Implement proper error handling for network failures
  3. Cache Management: Regularly clean up old cached files to save storage space
  4. Background Tasks: Use background tasks for large file uploads/downloads
  5. Network Optimization: Implement retry logic and adaptive quality based on network conditions
  6. Security: Validate file types and sizes before processing