Skip to content

A tus_client extension library for file backed persistent state of uploads

License

Notifications You must be signed in to change notification settings

steeple-org/flutter_package_tus_client_file_store

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tus client file store

Pub Version Build Status codecov


This is an extension library for tus_client for Flutter.

This library allows saving a file backed persistent state of uploads. This means the you can resume uploads even if the application is close or the device is restarted.

Note: This is only supported on Flutter Android, iOS and desktop, i.e. not web.

Installation

You need to add to your pubspec.yaml:

dependencies:
  tus_client: ^1.0.1
  tus_client_file_store: ^1.0.0

Usage

import 'package:path_provider/path_provider.dart';
import 'package:tus_client/tus_client.dart' show TusClient;
import 'package:tus_client_file_store/tus_client_file_store.dart' show TusFileStore;
import 'package:path/path.dart' as p;

// Directory the current uploads will be saved in
final tempDir = (await getTemporaryDirectory()).path;
final tempDirectory = Directory(p.join(tempDir, "tus-uploads"));

// Create a client
final client = TusClient(
    Uri.parse("https://example.com/tus"),
    file,
    store: TusFileStore(tempDirectory),
);

// Start upload
await client.upload();

About

A tus_client extension library for file backed persistent state of uploads

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 94.4%
  • Swift 4.0%
  • Kotlin 1.2%
  • Objective-C 0.4%