admin管理员组文章数量:1025457
I am trying to allow the user to download a file.
When the file is downloaded it is displayed in the browser window instead of downloading it.
Does anyone know of a way to get the iPhone to download files instead of viewing them.
Also all the code that I have tried works great on Android Devices.
Thanks.
I am trying to allow the user to download a file.
When the file is downloaded it is displayed in the browser window instead of downloading it.
Does anyone know of a way to get the iPhone to download files instead of viewing them.
Also all the code that I have tried works great on Android Devices.
Thanks.
Share Improve this question edited Sep 9, 2012 at 21:02 Alerty 5,9558 gold badges41 silver badges62 bronze badges asked Sep 9, 2012 at 20:53 OlokooOlokoo 1,1444 gold badges20 silver badges35 bronze badges 1- I have tried doc's and jpg's but the list is really unlimited. – Olokoo Commented Sep 9, 2012 at 20:59
2 Answers
Reset to default 6You can't. Apple have deliberately prevented things like this to protect their iOS from hacks and malware; you have no access (unless you are a developer, in which case its restricted) to the handsets integrated data storage.
Are you writing a program that downloads an image, or trying to do this as a user?
If you're writing a program, you can only download files to a limited number of locations. Your app's documents directory is the most obvious choice.
You will need to create an NSURLRequest, and then an NSURLConnection, and then implement a number of delegate methods to handle the ining data. Then you'll need to use NSFileManager methods to write the data to a file.
I am trying to allow the user to download a file.
When the file is downloaded it is displayed in the browser window instead of downloading it.
Does anyone know of a way to get the iPhone to download files instead of viewing them.
Also all the code that I have tried works great on Android Devices.
Thanks.
I am trying to allow the user to download a file.
When the file is downloaded it is displayed in the browser window instead of downloading it.
Does anyone know of a way to get the iPhone to download files instead of viewing them.
Also all the code that I have tried works great on Android Devices.
Thanks.
Share Improve this question edited Sep 9, 2012 at 21:02 Alerty 5,9558 gold badges41 silver badges62 bronze badges asked Sep 9, 2012 at 20:53 OlokooOlokoo 1,1444 gold badges20 silver badges35 bronze badges 1- I have tried doc's and jpg's but the list is really unlimited. – Olokoo Commented Sep 9, 2012 at 20:59
2 Answers
Reset to default 6You can't. Apple have deliberately prevented things like this to protect their iOS from hacks and malware; you have no access (unless you are a developer, in which case its restricted) to the handsets integrated data storage.
Are you writing a program that downloads an image, or trying to do this as a user?
If you're writing a program, you can only download files to a limited number of locations. Your app's documents directory is the most obvious choice.
You will need to create an NSURLRequest, and then an NSURLConnection, and then implement a number of delegate methods to handle the ining data. Then you'll need to use NSFileManager methods to write the data to a file.
本文标签: phpiPhone Force Download FilesStack Overflow
版权声明:本文标题:php - iPhone Force Download Files? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745622476a2159658.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论