Hi @Anjali Agarwal ,
Configure the static files middleware in Program.cs like below
app.UseStaticFiles(); // Serve files from wwwroot as usual
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider("C:\\test"),
RequestPath = "/RequestDisk" // URL path
});
Modify your link like below:
<a href="/RequestDisk/test6_259418_133433697138557958.pdf">test1</a>
Reference:
Serve files outside of web root
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Rena