v1.1.0
chunked_uploader
모바일, 데스크톱 및 웹용으로 Dio를 사용하여 파일을 조각 단위로 업로드하는 간편한 패키지입니다.
35좋아요 62330일 다운로드150Pub 점수
AndroidiOSmacOSWindowsLinux
서버로 파일을 청크 단위로 업로드하는 플러그인입니다.
>=4.0.0 <6.0.0^2.2.2^2.11.0아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A plugin to upload files to server in chunks.
pub package
To use this plugin, add chunked_uploader as dependency in your pubspec.yaml file.
dependencies:
flutter:
sdk: flutter
chunked_uploader: ^1.0.0
file_picker: ^5.2.5
dio: ^4.0.6
final file =
(await FilePicker.platform.pickFiles(withReadStream: true))!.files.single;
final dio = Dio(BaseOptions(
baseUrl: 'https://example.com/api',
headers: {'Authorization': 'Bearer'},
));
final uploader = ChunkedUploader(dio);
// using data stream
final response = await uploader.upload(
fileName: file.name,
fileSize: file.size,
fileDataStream: file.readStream!,
maxChunkSize: 500000,
path: '/file',
onUploadProgress: (progress) => print(progress),
);
// using path
final response = await uploader.uploadUsingFilePath(
fileName: file.name,
filePath: file.path!,
maxChunkSize: 500000,
path: '/file',
onUploadProgress: (progress) => print(progress),
);