URL Zeroing

Please forgive my ignorance. I am looking for a point in the right direction.

I have a page with some (pdf) download links. If I click the link, pdf will open on a new page. I see the folder where pdf is located on the server. If I am aware of other file names in the same folder, I might be lucky. Some of the files are private, so I don’t want the user to get a hint with a URL. How can I hide this information? We run .net 2 on the server. Can I call the method and open the file?

Any help appreciated. I'm not sure what to look for to start me.

thanks

We have a .Net server 2.

+3
source share
2 answers

PDF , , DownloadPdf.aspx, , :

Response.Clear();
Response.ContentType = "application/pdf";
Response.WriteFile(physicalPathToFile);
Response.End();

PDF , Response.End:

Response.AddHeader("content-disposition", "attachment; filename=" + filename);

( , ).

+12

. 100% , .resources, IIS filE.

+1

Source: https://habr.com/ru/post/1712206/


All Articles