471,575 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,575 software developers and data experts.

Force Download PocketIE and Mobile Browsers

Hi All,

I am writing an ASP.NET 2.0 Web Application that users can buy and download
pictures, songs, etc. I have a page that servers as the download page that
fetches the file to be downloaded from a physical path on my server,pops up
the Save As dialog and using HTTP Response downloads the file. It works
great off desktop IE, but when i try the same page from PocketIE it just
fetches the image and displays it in IE. How can i make it popup the Save
As dialog in PocketIE? any ideas or maybe another way that this could be

Here's the code i am using:

if (!IsPostBack)


string SessionId = "";

SessionId = Request.QueryString["id"];
if (SessionId != "")


FileStream fs;

string szFilePath =
System.Configuration.ConfigurationManager.AppSetti ngs["Path"];

string szFileName = GetFileName(SessionId);

szFilePath = szFilePath + szFileName;

fs = File.Open(szFilePath, FileMode.Open);

byte[] byteBuffer = new byte[fs.Length];

fs.Read(byteBuffer, 0, (int)fs.Length);


Response.AddHeader("Content-disposition", "attachment; filename=" +

Response.ContentType = "application/octet-stream";







Thanks a lot for your help really appreciated

Mustafa Rabie
Jun 28 '06 #1
0 1043

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Kevin Muenzler, WB5RUE | last post: by
13 posts views Thread by ron1972 | last post: by
4 posts views Thread by Microsoft | last post: by
1 post views Thread by JayLembeck | last post: by
4 posts views Thread by howa | last post: by
5 posts views Thread by rn5a | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by Vinnie | last post: by
1 post views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.