c# - Download file that lives elsewhere on the harddrive -
An aspx page that displays the file to the user to download These files can be an extension and remain outside the wwwroot folder. They appear in a treeview, I would like the user to be able to download any file on which they click.
I have tried the following, but it is only giving me the ASPX page.
Parents The text folder is where the file resides in the node. If the text file is a name then something like: c: \ dir \ text.txt
Response .AppendHeader ("content-break", string.format ("attachment; filename = {0}" The path will be included. The alliance (parent, text, node, lesson));
The file name header value indicates the name to present the user browser (actual No path to file).
In order for the user to get the file, you have to output it in response. The method helps a lot with this.
Response Append word header ("content-break", string.format ("attachment; filename = {0}", node. Text)); Response. Transmission file (path. Cobine (parent text, node text)); Response.End ();
Comments
Post a Comment