flutter_nearby_connections icon indicating copy to clipboard operation
flutter_nearby_connections copied to clipboard

File resources sharing

Open FelixYew opened this issue 3 years ago • 10 comments

Possible to implement file sharing with nearby connection.

FelixYew avatar Nov 21 '20 13:11 FelixYew

No, the current only supports transfer data raw

VNAPNIC avatar Nov 21 '20 14:11 VNAPNIC

Please consider to include this feature. Thanks

FelixYew avatar Nov 21 '20 14:11 FelixYew

ok, u can follow the progress here https://github.com/VNAPNIC/flutter_nearby_connections/projects/3

VNAPNIC avatar Nov 21 '20 16:11 VNAPNIC

👍 +1 for file sharing

prateekmedia avatar Jan 12 '21 03:01 prateekmedia

u can convert image into byte array and byte array to base64 String

like that:

List imageBytes = widget.fileData.readAsBytesSync(); print(imageBytes); String base64Image = base64Encode(imageBytes);

VNAPNIC avatar Jan 27 '21 13:01 VNAPNIC

u can convert image into byte array and byte array to base64 String

What if someone wants to build a file sharing app using that, than this hack would not work. :(

prateekmedia avatar Apr 07 '21 15:04 prateekmedia

Is there a size limit? I tried sending the base64Image string but I cant receive it on the other device :(

ether-how avatar Aug 10 '21 14:08 ether-how

Is there a size limit? I tried sending the base64Image string but I cant receive it on the other device :(

Did u solve this problem?

AliAlHourash avatar Feb 07 '22 08:02 AliAlHourash

Is there a size limit? I tried sending the base64Image string but I cant receive it on the other device :(

Did u solve this problem?

Kind of. Since they're already in a base64 string, i split them up into strings of 1500 length and sent them one by one with the max number of parts and corresponding part number attached. Once the receiver receives the the last part, do a check if the number of parts received is equal to the max number of parts. Then if nothing is missing, merge them into a single string and convert it to whatever you want. Eg. Image, File etc. I did this for images and voice recordings.

ether-how avatar Feb 08 '22 04:02 ether-how

Kind of.

@ether-how Can you provide a more detailed example?

serzhikdnepr avatar Aug 08 '22 20:08 serzhikdnepr