使用ASIHTTPRequest下载文件-iPhone应用程序 [英] Downloading file with ASIHTTPRequest - iPhone app

查看:64
本文介绍了使用ASIHTTPRequest下载文件-iPhone应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ASIHTTPRequest源代码从远程位置下载文件.令人惊讶的是,下载发生了,但是此后什么也没有发生.我在 handleBytesAvailable 方法中添加了一条日志语句,可以看到部分文件已下载了整个文件中包含的数据,并将其添加到了 fileDownloadOutputStream 变量中.

I am using the ASIHTTPRequest source code to download a file from a remote location. Surprisingly, the download happens but nothing happens after that. I have put in a log statement in the handleBytesAvailable method and can see the entire file worth of data is downloaded in parts and added to the fileDownloadOutputStream variable.

但是,一旦所有字节下载完毕,就什么也没有发生.不会调用委托方法(既不会失败,也不会成功).

But once all the bytes have been downloaded, nothing happens. The delegate methods are not called (neither fail, nor success).

有人可以告诉我发生了什么事吗?还是使用ASIHTTPRequest从远程服务器下载文件的正确方法是什么?

Can someone please tell me what is happening? Or what is the correct way to download a file from a remote server using ASIHTTPRequest?

谢谢.

更多详细信息

在放置更多日志语句时,似乎所有字节下载完毕后,请求类将获得超时响应.之后,不调用委托方法.不确定为什么会发生超时,因为从日志中我可以看到文件的所有字节都已经下载了.这有帮助吗?

On putting more log statements, it appears that after all the bytes have been downloaded, the request class gets a timeout response. And after that the delegate methods are not called. Not sure why the timeout should happen because I can see from the logs that all the bytes of the file have been downloaded already. Does this help?

推荐答案

您是否在ASIHTTPRequest对象上设置了委托?

Have you set a delegate on the ASIHTTPRequest object?

这篇关于使用ASIHTTPRequest下载文件-iPhone应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆