上传到http://192.168.1.239/1/111文件夹里控制台输出成功,但是wangshuangli文件夹里缺没有图片,为什么?
但是从这个文件夹里下载文件能下载保存到沙盒里
下载的代码
-
(void)downLoadData {
NSURL *url = [NSURL URLWithString:@"http://192.168.1.239/1/111/12.txt"];
AFURLSessionManager *sessionManager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
sessionManager.responseSerializer = [AFHTTPResponseSerializer serializer];
NSURLSessionDownloadTask task = [sessionManager downloadTaskWithRequest:[NSURLRequest requestWithURL:url] progress:nil destination:^NSURL (NSURL targetPath, NSURLResponse response) {NSString *downLoadPath = [NSString stringWithFormat:@"%@/Documents/12.txt",NSHomeDirectory()]; return [NSURL fileURLWithPath:downLoadPath];
} completionHandler:^(NSURLResponse response, NSURL filePath, NSError *error) {
NSLog(@"filePah:%@",filePath);
} ];
[task resume];
}
谢谢?
你的服务器是用什么来做的呢?这个问题看起来不像是在客户端,你需要检查一下你的服务器端的实现。