Flutter“ftpconnect”上传图像时无法正常工作

i1icjdpr  于 2023-06-07  发布在  Flutter
关注(0)|答案(1)|浏览(146)

所以我有一个应用程序,上传图像到ftp服务器使用此代码:

try {
    File fileToUpload = File(filePathPharmacy);

    await ftpConnect.connect();
    await ftpConnect.changeDirectory(
        "/public_html/XXXXXX/XXXXXX/main/assets/userImags");

    bool res =
        await ftpConnect.uploadFileWithRetry(fileToUpload, pRetryCount: 3);
    await ftpConnect.disconnect();
    print(res);
  } catch (w) {
    print("error : $w");
  }

解释:

filePathPharmacy => Is the Path of the file . Example :- /data/user/0/come.adeeb.smartbureau/app_flutter/b2042f2e-bd9e-4d91-8775-7b8e26d124886989878843844875758.jpg

XXXXXX => is my location on the server (I hade it for security)

成功了!我就能在FTP服务器上找到文件
但图像分辨率不好或它遭受奇怪的扭曲!

有办法解决吗?

dfuffjeb

dfuffjeb1#

将以下命令置于

bool res =await ftpConnect.uploadFileWithRetry(fileToUpload, pRetryCount: 3);

命令:

await ftpConnect.sendCustomCommand('TYPE I');

相关问题