iPhone 下载应用程序

发布于 2024-07-25 12:18:33 字数 425 浏览 3 评论 0原文

我想问一下,从.php等URL引擎下载数据是否简单? 从直接网址下载,例如这个 http://www.rarlab.com/rar/wrar380使用 NSURLConnection .exe 非常简单。 但如果我在rapidshare.com或download.cnet.com等服务器上使用NSURLConnection,它就不起作用。 我知道为什么了,因为它正在下载URL的内容,而这个页面的URL内容是一个网页。 所以我的问题是,是否可以重定向到该服务器上的文件 URL,如果可以,您能给我一个学习方向或类似的信息吗? 我真的不需要解决方案,但我不知道如何解决它。 我唯一知道的是,在网页上这是通过使用一些标头来完成的,但我不知道 PHP。 感谢您的回复。

I want to ask you whether it is simple to download data from URLs engind such as .php etc. or not. Downloading from direct urls, such as this one http://www.rarlab.com/rar/wrar380.exe is really simple using NSURLConnection.
But if I use NSURLConnection on servers like rapidshare.com, or download.cnet.com etc. it is not working. I know why, because it is downloading content of URL and content of URL on this page is a web page.
So my question is, is it possible to redirect to file URL on this servers, and if it is, could you give me a direction where to learn it or something like that? I really don't need solution, but I haven't a clue how to solve it. Only thing I know is that on web pages this is done by using some headers, but I don't know PHP.
Thanks for replies.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寂寞陪衬 2024-08-01 12:18:33

像 download.cnet.com 这样的服务器会将用户重定向到离他们更近的镜像。 您必须允许 NRURLConnection 进行重定向。

请参阅 http ://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html#//apple_ref/doc/uid/20001836-160106

Server's like download.cnet.com will redirect the user to a mirror closer to them. You have to allow redirects with you NRURLConnection.

See http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html#//apple_ref/doc/uid/20001836-160106

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文