使用 Objective-C 上传图像
我正在为 Web 服务编写 iPhone 应用程序,并且需要将图像上传到该服务。在网络版本中,它使用 AJAX。但我对此知之甚少。我在网页上找到了以下上传按钮的代码:
if (button.length) {
new AjaxUpload(button, {
action: '/Media/UploadFile',
responseType: 'json',
onSubmit: function (file, ext) {
$('#bBar').progressBar(0);
var uid = createUUID();
timerID = setTimeout(function () { checkImageUploadProgress(uid, 1, 'image') }, 1000);
startUpload();
this.setData({ fileType: 1, guid: uid, DJUploadStatus: '::DJ_UPLOAD_ID::' + uid });
},
onComplete: function (file, response) {
}
});
}
How should I Implement this function using the NSConnection class?
I'm writing an iPhone app for a web service and I need to upload image to the service. In the web version, it's using AJAX. But I know little about that. I find the following code on the web page for the upload button:
if (button.length) {
new AjaxUpload(button, {
action: '/Media/UploadFile',
responseType: 'json',
onSubmit: function (file, ext) {
$('#bBar').progressBar(0);
var uid = createUUID();
timerID = setTimeout(function () { checkImageUploadProgress(uid, 1, 'image') }, 1000);
startUpload();
this.setData({ fileType: 1, guid: uid, DJUploadStatus: '::DJ_UPLOAD_ID::' + uid });
},
onComplete: function (file, response) {
}
});
}
How should I implement this function using the NSConnection class?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
iPhone 上的 FTP 与 HTTP 上传
从 iPhone 应用程序上传图像
将图像与其他数据一起上传POST
iPhone UIImage 上传到网络服务
还有更多。
我相信您一定能找到这些问题的答案。
FTP vs HTTP upload on iPhone
upload image from iPhone application
Upload image along with other data in same POST
iPhone UIImage upload to web service
And there's plenty more.
I'm sure you'll manage to do it the answers to these questions.