iPhone上下载图像的问题 [英] problem on download image in iphone

查看:83
本文介绍了iPhone上下载图像的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家晚上好,
我开发了一个移动应用程序.
在下载文件代码中,我编写了以下代码:

Hi good evening to all,
I developed one mobile application.
In download file code I wrote the code below:

//code(C#)
Response.ClearContent();
Response.AppendHeader("Content-Disposition", "attachment;filename=" filename with ext;
Response.AddHeader("Content-Length", fileLength);
Response.ContentType = content type;
Response.TransmitFile(file.FullName);
Response.End();



上面的代码在诺基亚手机中有效.
但是它不能在苹果i-phone(Safari浏览器)中使用.
请任何人给我解决方案.
谢谢.



The above code is working in Nokia phone.
But it is not working in apple i-phone(safari browser).
Please any one give me the solution.
Thank you.

推荐答案

无法完成.

没有将内容从浏览器下载到手机的概念.在iPhone系统中没有任何意义.

iPhone是封闭系统.每个应用程序(包括浏览器)都在其自己的沙箱中运行.每个沙箱都包含其自己的特定于应用程序的文件系统,并且没有应用程序可以访问任何其他应用程序的文件.

假设您的代码可在Mac上的Safari上运行,则下载将最终在用户〜/Download文件夹中.然后,您将转到Mac上的其他应用程序,访问该文件夹并使用您下载的内容(无论它是什么,图片,数据等)进行某些操作

在iPhone上,即使您通过Safari下载了某些内容,它也将最终出现在Safari沙箱中,这将是完全无用的.因此,他们不必在iPhone上支持它.

有一种特殊的方法可以从Safari将图像下载到用户相册(可通过任何应用以有限的方式访问)中的图片-但这是用户执行的操作:http://www.tuaw.com/2008/07/17/iphone-101-saving-images-in- safari/ [ ^ ]

您可以编写本机的Objective-C应用程序,该应用程序可以从网站下载到用户相册.但是您不能从基于浏览器的应用程序中做到这一点.
Can''t be done.

There is no concept of downloading something from the browser to the phone. It doesn''t make any sense in the iPhone system.

The iPhone is a closed system. Every application (including the browser) runs in it''s own sandbox. Each sandbox includes it''s own application specific file system and no application has access to the files of any other application.

Assuming your code works on Safari on a Mac, the download would end up in the users ~/Download folder. Then you''d go to some other application on your Mac, access that folder and do something with what you downloaded (whatever it was, picture, data, etc.)

On an iPhone, even if you downloaded something, via Safari, it would end up in the Safari sandbox which would be completely useless. So they don''t bother with supporting it on the iPhone.

There is a special way to download images to the users photo album (which is accessible in a limited fashion by any app) from Safari -- but that''s something a user does: http://www.tuaw.com/2008/07/17/iphone-101-saving-images-in-safari/[^]

You can write a native Objective-C app that can download from a website to the users photo album. But you can''t do it from a browser based app.


这篇关于iPhone上下载图像的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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