0

im trying to download a file from my asp website onto a mobile device. im currently using this code which works perfectly on desktop devices however does not seem to want to download when accessing the mobile version of the site. Please help

code snippet of desktop and mobile code:

Response.ContentType = "application/docx";
        Response.AppendHeader("Content-Disposition", "attachment; filename=Menu.docx");
        Response.TransmitFile(Server.MapPath("~/Documents/Menu.docx"));
        Response.End();
  • It really should't be any different on a mobile device. As a side note, I'd change the content type to be all lower case. It may not matter for all clients, but I'd do it just to be safe. Also, your content type doesn't match your file extension. You have the content type for a PDF document, and the file extension for a Word document. Is the file actually a Word document? – mason Oct 16 '17 at 17:00
  • yes its a word document, please advise me on the correct extension to use – Wade Martin Oct 16 '17 at 17:10
  • See [What is a correct mime type for docx, pptx etc?](https://stackoverflow.com/questions/4212861) – mason Oct 16 '17 at 17:14
  • changed what needed to be changed however does not download on mobile device still – Wade Martin Oct 16 '17 at 17:19
  • Please edit your question to reflect your current code. – mason Oct 16 '17 at 17:21
  • done with edits – Wade Martin Oct 16 '17 at 18:13
  • Did you actually look at the link I provided you for the MIME type? It clearly doesn't say to use "application/docx" like you've shown in the updated code. – mason Oct 16 '17 at 18:19

0 Answers0