How to enable downloading of files from an ASP.NET(Framework) Web Application to Mobile in IIS

I am running an IIS server from my local machine and hosting it on an HTTP port.

I have developed a dummy uploading scenario to test on my website and it works from computer based browsers – this includes uploading and downloading of any files. It however has limited functionality on mobile browsers, mobile browsers allow for uploading of documents but when clicking the download button instead of downloading example.png it downloads http://www.example.com/uploadingexamplepage.aspx . In short, mobile browsers are downloading the entire web page and not the file being requested. How do i solve this ?

This is the method associated with the download button click inside of a DataGrid:

public void SelectedIndexChanged()         {             string filePath = Server.MapPath("~/Data/" + Session["username"].ToString() +                                Session["uniqueid"].ToString() + "/" +                                dgvAWE.SelectedItem.Cells[0].Text);             Response.ContentType = ContentType;             Response.AppendHeader("Content-Disposition", "attatchment; filename=" +                                    Path.GetFileName(filePath));             Response.WriteFile(filePath);             Response.End();         } 

Any assistance would be greatly appreciated.

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.