file_upload

Creator: coderz1093

Last updated:

Add to Cart

Description:

file upload

#file_upload
A Flutter plugin to send files as a request to the server
Usage #
Please change the localhost url for the url server
import 'package:file_upload/file_upload.dart';


//In this example we use the localhost url but you will change the url
// for the url sever
String _url = 'http://10.0.2.2:5000';
FileUpload fileUpload = FileUpload();

Future<void> sendFiles() async {
String url = '$_url/request1';
/*
uploadTwoFiles()
Params:
String url,
String fileKey1,
String filePath1,
String fileType1,
String fileKey2,
String filePath2,
String fileType2
*/
response1 = await fileUpload.uploadTwoFiles( url,'video',path1!,'mp4','image',path2!,'jpg');
print(response1);
}

Future<void> sendFile() async {
/*uploadFile()
Params:
String url,
String fileKey,
String filePath,
String fileType)
*/
String url = '$_url/request2';
// url,fileKey,filePath,fileType
response2 = await fileUpload.uploadFile(url,'audio',path3!,'wav');
print(response2);
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.