Open vancuf opened 2 years ago
this is not this package specific question?
but you can run a for loop for every file path in _sharedFiles and add the links to a list. may be this can help you https://stackoverflow.com/a/63269887
this is not this package specific question?
but you can run a for loop for every file path in _sharedFiles and add the links to a list. may be this can help you https://stackoverflow.com/a/63269887
The stackover link not working.
this should work https://stackoverflow.com/questions/63263840/how-to-upload-multiple-images-files-in-flutter-using-dio/63269887#63269887
Yes this works with one url but the problem i am having is breaking up multiple urls "/data/user/0/com.example.share_app/cache/20210615_213948.jpg,/data/user/0/com.example.share_app/cache/Screenshot_2018-05-11-20-38-25.png" then uploading with dio
you can split the string with String's split(","); method. Or better - dont merge the string in first place. make a list of string and when maping through the _sharedFiles, add each file path to the list.
You can use my plugin flutter_sharing_intent
How do I format the links to upload multiple files to a NodeJS server? So far I can only upload files one by one. the URLs format for multiple share is one long URL "/data/user/0/com.example.share_app/cache/20210615_213948.jpg,/data/user/0/com.example.share_app/cache/Screenshot_2018-05-11-20-38-25.png"
This is the dio.dart uploader I am using, it can only upload one file at a time. uploadFile(filename) async { var formData = FormData(); formData.files.addAll([ MapEntry( "files", MultipartFile.fromFileSync( _sharedFiles?.map((f) => f.path)?.join(",") ?? "")) ]); Response response = await Dio().post("http://192.168.0.7:3000/upload", data: formData); print(response.toString()); }