简体   繁体   中英

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM