I have created a webpage using RazorPages, where I want the user to be able to download GPX files to get maps of terrains.
The map is also pictured in a PDF file, which I am able to download. The files are uploaded to this path: wwwroot/assets/products/[productID]/[fileID] which associates the file to the product. I can see that the file is uploaded correctly, as a .gpx file. However, when I try downloading it using this tag:
<a href="~\assets\products\5ad37306-e07a-4965-900c-e8559a4142a4\5900223c-c067-4299-a700-a8a958b49117_fells_loop.gpx" download="GPX_file">Download GPX file</a>
It downloads an empty .txt file:
By adding .gpx to the download attribute, it downloads an empty .gpx file:
<a href="~\assets\products\5ad37306-e07a-4965-900c-e8559a4142a4\5900223c-c067-4299-a700-a8a958b49117_fells_loop.gpx" download="GPX_file.gpx">Download GPX file</a>
I know the file is uploaded correctly, because I can find the file with content in this exact path on my computer, and also in the solution explorer. By opening it, the content is displayed, and I can use the .gpx file.
Every other filetype I've tried works fine (txt, pptx, docx, xsls, csv, pdf, png, jpeg), but gpx seems to be an issue.
What causes this, and how can I fix it, and be able to download gpx files?


