I have developed one wap page using Microsoft Mobile control form in .net in c#.
On click of button, i need to download the mp3 file into cell phone. Its downloaded successfully to my cell phone. But open in the web page rather then in real player of my cell phone Nokia N 72. When I access the same page from Internet Browser like Mozilla, IE etc. then file save successfully and played in player.
For more Detail, i ma putting my code also.
protected void CmdDownload_Click(object sender, EventArgs e)
string originalFilename = strFileName;
string localfilename = Server.MapPath("~/RingtoneFiles") + "/" + strFileName;
WebClient req = new WebClient();
CredentialCache mycache = new CredentialCache();
mycache.Add(new Uri(localfilename), "Basic", new NetworkCredential("administrator", "admin$123"));
req.Credentials = mycache;
HttpResponse response = HttpContext.Current.Response;
response.Buffer = true;
response.AddHeader("Content-Disposition", "attachment;filename=\"" + originalFilename + "\"");
byte data = req.DownloadData(localfilename);
catch (Exception ex)
if (ex.Message == "The remote server returned an error: (404) Not Found.")
throw new Exception("File not found");
else if (ex.Message == "The remote server returned an error: (401) Unauthorized.")
throw new Exception("Unauthorized access");
Anyone can help me or can provide any sample code or link for solving my problem. I will be very greatfull to you.