ASPNET Process need to read files from another computersystem
There are two servers: webserver and server with PDF files. The webapplication need to read these files and redirect to the client (with Response class). But access from the webapplication to the another server is denied.
Webserver is member of domain, server with PDF f开发者_开发知识库iles not.
What is the best solution to get access to the folder of files from the webapplication on the webserver? How to set the credentials?
Three options for you:
- Have the ASP.NET process impersonate a user account with rights on the file server. Here's a similar StackOverflow question with some good answers:
Need to Impersonate user forAccessing Network resource, Asp.Net Account
Don't pass the PDF files through the web server, just redirect the client to the UNC path where the PDF files are stored (if it is accessible to your users, i.e., the web site is running only within an internal network and the users have read rights on the PDF server.
Install IIS on the file server pointed to the files, then have ASP.NET on your main web server either (a) redirect users to the file on that server, or (b) read the files using ASP.NET's HTTP functionality and pass them to the Response.
精彩评论