![prompts to download aspx file prompts to download aspx file](https://www.thewindowsclub.com/wp-content/uploads/2020/09/hide-file-extensions.png)
The documentation says that it indicates "whether to send HTTP content to the client". You have said in previous comments that you have tried the CompleteRequest command to no avail.Īs a note, I am not 100% certain to the logistics of the Response.SuppressContent() command.
![prompts to download aspx file prompts to download aspx file](https://csharpcorner-mindcrackerinc.netdna-ssl.com/UploadFile/0c1bb2/uploading-and-downloading-excel-files-from-database-using-as/Images/demoscreen.png)
So I know this question is older, but the solution I finally came up with to this problem is to add the following two lines to my code. same thing each time.ĮDIT2: Simplified everything down to a single button on a completely blank page. DOC, and every other format I've tested.ĮDIT: Have also tried Response.WriteFile as well as Response.BinaryWrite. It is not limited to PDF, same happens with. I've tried a number of different header options and the MIME type makes no difference.ĭoes anyone have a clue why this would be happening? Response.ContentType = "application/octet-stream"
![prompts to download aspx file prompts to download aspx file](https://www.syncfusion.com/blogs/wp-content/uploads/2020/08/How-to-Develop-an-ASP.NET-Core-Application-Using-Visual-Studio-Code-2.jpg)
Response.AddHeader("Content-Disposition", "attachment filename=" & testFile.Name)
PROMPTS TO DOWNLOAD ASPX FILE CODE
The code is rather straightforward: testFile = New System.IO.FileInfo("\\someshare\somefolder$\Document.pdf") But for some reason, IE isn't setting the name and instead uses the ASPX name. The file gets downloaded with the correct filename. When I get a download prompt in IE11, it says:ĭo you want to open or save "SomePage.aspx?fileID=12345"? ĭo you want to open or save "Document.pdf"? I am trying to transmit a file on the local intranet site.