I have a "ticket system" and when the user creates a ticket there is an option to upload files. Those files go to a folder that have the name of the ticket.
This is the code that creates the folder when the ticket is created.
var nomePasta = "Ticket Id - " + idNovoPedido;
string salva = Path.Combine(Server.MapPath("~/"),"uploadedFiles",nomePasta);
Directory.CreateDirectory(salva);
Then on the backoffice i can see if there are any files on that folder.
Code to check if there are any files:
@foreach (string fullFilePath in Directory.GetFiles(Path.Combine(Server.MapPath("~/uploadedFiles"),"Ticket Id - "+@id)))
{
<div class="linkFicheiros">
<a href="@Href("~/uploadedFiles","Ticket Id - "+@id,Path.GetFileName(fullFilePath))">@Path.GetFileName(fullFilePath)</a>
</div>
}
Now my question is, how can i download the files?
If i click on a link (example if it's a photo, my browser opens a new window and show me the image) and if it's a "docx" it says that "The page cannot be found."
Update:
So i've found something, if the file is ".xls" i can download it without any problem, but if the file is ".docx" it gives the error mentioned above "The page cannot be found.".
Any thoughts ?