Closed mrboggyman16 closed 7 months ago
Facing the same error.
Image got corrupt while downloading and throwing this error
E/FlutterJNI( 4321): Failed to decode image E/FlutterJNI( 4321): android.graphics.ImageDecoder$DecodeException: Failed to create image decoder with message 'unimplemented'Input contained an error. Flutterr image error
Hello. I also ran into the same issue with file uploads and downloads. So I looked into the source code of "ftpconnect". In 'ftp_socket.dart', 'TransferType.auto' is the default, sending commands with 'TYPE A'. Normally, we should use 'TYPE A' for text-based files and 'Type I' for byte mode (binary mode) files such as image files, depending on the type of file we want to send and receive. So when uploading files, for byte mode files, I inserted "await ftpConnect.sendCustomCommand('TYPE I');" before "await ftpConnect.uploadFile(fileToUpload);". The result was a success. Also when downloading files, for byte mode files, I inserted "await ftpConnect.sendCustomCommand('TYPE I');" before "await ftpConnect.downloadFile(fileName, File('myFileFromFTP.txt'));". The results were equally successful. Try it yourself as well.
thnx to @TakaTeke, just try as he said or:
ftpConnect.setTransferType(TransferType.binary);
And don't forget to go back to
ftpConnect.setTransferType(TransferType.auto);
I am downloading image from ftp and saving it into a file but when I ma trying to show it son screen I got this exception
Can anyone help ?