How to download file with read only in ASP .NET website?
I have a file present on server. The file on server is read-only. When I download the file from ASP .NET application to my local machine, the file has read and write access both. The original read-only attribute removed. I want to download the file read-only mode. Could you please suggest the proper solution for this problem.
I have tried below solution.
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "attachment; filename=MyFile.pdf");
Response.TransmitFile(Server.MapPath("~/Files/MyFile.pdf"));
Response.End();
On server, this file has read-only attribute, but if I download using above code, the read-only attribute remove automatically in client location. I want to prevent file read-only after downloading. Please suggest some solution.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Uttam ChaturvediRank #477 · 5.2K reputationPosted Mar 2, 2018, 4:41 AM EST
Nitin SontakkeRank #264 · 9.6K reputationPosted Mar 2, 2018, 10:47 PM EST