gpt4 book ai didi

ios - 上传文件到ftp服务器时出现未知错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:48:18 25 4
gpt4 key购买 nike

我正在尝试将图像文件上传到服务器。我正在应用 https://github.com/valentinradu/WhiteRaccoon 中的示例

代码如下:

    UIImage *image = [UIImage imageNamed:@"hotel1.jpg"];
NSData *imageData = UIImageJPEGRepresentation(image, 0);

WRRequestUpload * uploadImage = [[WRRequestUpload alloc] init];
uploadImage.delegate = (id)self;

//for anonymous login just leave the username and password nil
uploadImage.hostname = @"***.***.***.***";
uploadImage.username = @"-------";
uploadImage.password = @"-------";

//we set our data
uploadImage.sentData = imageData;

//the path needs to be absolute to the FTP root folder.
//full URL would be ftp://xxx.xxx.xxx.xxx/space.jpg
uploadImage.path = @"/android_images/image.jpg";

//we start the request
[uploadImage start];

但它给出错误 -[WRRequestListDirectory stream:handleEvent:] [Line 1004] Unknown error!

我错过了什么吗?请帮帮我。

最佳答案

在 uploadimage.hostname 属性中尝试跳过 ftp://部分并单独输入主机地址,例如:“qwerty.com”而不是“ftp://qwerty.com”,它为我解决了,并确保身份验证给出的细节是正确的。欢呼!!

关于ios - 上传文件到ftp服务器时出现未知错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12722859/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com