how to upload and download images to ftp server in flutter?

Viewed 493

please help me to downloading and uploading operation to a ftp server in flutter camera Application. which package using for this operation?

2 Answers

You can use Socket .

dependencies:
  web_socket_channel: ^2.0.0

import 'package:web_socket_channel/io.dart';
import 'package:web_socket_channel/status.dart' as status;

    void main() {
      final channel = IOWebSocketChannel.connect('ws://localhost:1234');
    
      channel.stream.listen((message) {
        channel.sink.add('received!');
        channel.sink.close(status.goingAway);
      });
    }

What I did is edit the android/app/androidmanifest.xml and add:

uses-permission android:name="android.permission.INTERNET"

Also add this package your pubspec.yaml:

dependencies:
  ftpconnect: ^1.0.0
Related