resume_upload_sdk 1.0.0 copy "resume_upload_sdk: ^1.0.0" to clipboard
resume_upload_sdk: ^1.0.0 copied to clipboard

A Flutter SDK for resumable file uploads with chunk-based upload support and automatic resume capability. Supports pause, resume, cancel, and progress tracking across all platforms.

resume_upload_sdk #

A Flutter SDK for resumable file uploads with chunk-based upload support and automatic resume capability.

Features #

  • Resumable uploads - Automatically resumes interrupted uploads from where they left off
  • Chunk-based - Splits large files into configurable chunks for reliable uploading
  • Progress tracking - Real-time upload progress via stream-based callbacks
  • Pause / Resume / Cancel - Full control over upload lifecycle
  • CRC32 verification - Integrity checks for each uploaded chunk
  • Cross-platform - iOS, Android, macOS, Windows, Linux, and Web
  • Concurrent uploads - Manage multiple upload tasks simultaneously

Getting Started #

Installation #

Add to your pubspec.yaml:

dependencies:
  resume_upload_sdk: ^1.0.0

Then run:

flutter pub get

Usage #

Initialize the upload manager

import 'package:resume_upload_sdk/resume_upload_sdk.dart';

final config = UploadConfig(
  baseUrl: 'https://your-server.com/api/upload',
  timeoutSeconds: 30,
  maxRetries: 3,
);

await UploadManager.instance.initialize(config);

Upload a file

final result = await UploadManager.instance.upload(
  filePath: '/path/to/file.pdf',
  onProgress: (progress) {
    print('Upload progress: ${progress.percentage}%');
  },
  onComplete: (result) {
    print('Upload complete: ${result.success}');
  },
);

Manage uploads

// Create a task for more control
final task = UploadManager.instance.createTask(filePath: '/path/to/file.pdf');

// Start
final result = await task.start();

// Pause
task.pause();

// Resume
await task.resume();

// Cancel
task.cancel();

// Listen to progress
task.progressStream.listen((progress) {
  print('${progress.percentage}%');
});

Custom configuration per upload

final customConfig = UploadConfig(
  baseUrl: 'https://your-server.com/api/upload',
  timeoutSeconds: 60,
  maxRetries: 5,
  retryDelayMs: 2000,
  headers: {'Authorization': 'Bearer token'},
  userId: 'user-123',
);

await UploadManager.instance.upload(
  filePath: '/path/to/large-file.zip',
  config: customConfig,
);

Server Requirements #

This SDK expects a server that implements the chunked upload protocol with the following endpoints:

  • Init upload - Register a new file upload and receive upload metadata
  • Upload chunk - Upload individual file chunks with CRC32 verification
  • Merge chunks - Signal the server to merge all chunks into the final file

A reference backend implementation is available in the repository.

License #

Licensed under the Apache License, Version 2.0. See LICENSE for details.

2
likes
0
points
135
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter SDK for resumable file uploads with chunk-based upload support and automatic resume capability. Supports pause, resume, cancel, and progress tracking across all platforms.

Repository (GitHub)
View/report issues

Topics

#upload #file-upload #resumable #chunk-upload

License

unknown (license)

Dependencies

connectivity_plus, crypto, flutter, http, path, shared_preferences, uuid

More

Packages that depend on resume_upload_sdk