shaqian / flutter_ssh

SSH and SFTP client for Flutter
https://pub.dartlang.org/packages/ssh
MIT License
117 stars 83 forks source link

sftp upload function not work #22

Open GyunHo opened 4 years ago

GyunHo commented 4 years ago

After creating an image file with imagepicker, I entered the path of the image file as the file path. But I get a No such file error. The connection status and download function work. But I don't know how to use the upload function. How does it work?

shaqian commented 4 years ago

Hi @GyunHo,

I'm not sure what file path is returned from imagepicker. If download function works, you can set a breakpoint here https://github.com/shaqian/flutter_ssh/blob/master/example/lib/main.dart#L136 get the value of filePath, then check if the file path from imagepicker is in the same format.

Thanks, Qian

GyunHo commented 4 years ago

Hi @GyunHo,

I'm not sure what file path is returned from imagepicker. If download function works, you can set a breakpoint here https://github.com/shaqian/flutter_ssh/blob/master/example/lib/main.dart#L136 get the value of filePath, then check if the file path from imagepicker is in the same format.

Thanks, Qian

Yes, if the download is successful, I think it should be possible to upload again based on the filepath. But even if i run the example, will get no Such File when uploading. Am I doing something wrong ...? Does upload work as well as the example? Thank you for your attention.

shaqian commented 4 years ago

Upload in the example app should work.

Can you please share an example of the file path you got?

Thanks, Qian

IsaBass commented 4 years ago

I am unable to connect to any ftp server. Have you been able to connect with the SSH package? Filezilla connects normally. My desktop application also connects to the server, but I have not been able to connect with the SSH package. The app freezes on the client.connect () command; without any error message.

shaqian commented 4 years ago

@IsaBass Are you able to debug the app in XCode or Android Studio? Please set a breakpoint in the connectToHost() function then step in to see where it gets stuck.

For iOS: https://github.com/shaqian/flutter_ssh/blob/master/ios/Classes/SshPlugin.m#L114 For Android: https://github.com/shaqian/flutter_ssh/blob/master/android/src/main/java/sq/flutter/ssh/SshPlugin.java#L215

Thanks, Qian