Click here to Skip to main content
15,898,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi good evening to all,
I developed one mobile application.
In download file code I wrote the code below:

C#
//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();


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.
Posted
Updated 9-Sep-11 2:32am
v2

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900