【发布时间】:2012-01-09 09:08:08
【问题描述】:
从 iPhone 压缩和上传文件的最佳方式是什么?我正在使用 ASIHTTP 将文件上传到我的服务器。但是在将大文件上传到服务器时出现网络错误。那么如何使用 ASIHTTP 压缩和上传呢?
Code:
[serverUploadRequest setPostValue:withEmail_id forKey:@"mail_id"];
[serverUploadRequest setPostValue:withPassword forKey:@"pwd"];
[serverUploadRequest setPostValue:withFileName forKey:@"file_name"];
[serverUploadRequest setPostValue:withFileExtension forKey:@"file_extension"];
[serverUploadRequest setData:fileData withFileName:withFileName andContentType:@"application/octet-stream" forKey:@"userfile"];
[serverUploadRequest startSynchronous];
这工作正常,但是当我尝试上传大文件时,有时会出现上传失败错误。因此可以将文件压缩并上传到服务器。我正在使用带有 PHP 的 windows 2003 服务器
谢谢
【问题讨论】:
-
邮政编码和错误以获得更好的结果
-
我要上传文本文件或pdf文件。
-
您能否发布您的网络服务器日志,以便我们了解您遇到了什么样的错误(正文太长...)