Reputation: 15463
I have a scenario where I need to upload a file from one web application and use it in another one. My setup is the following.
So where and how can I upload the file so that it can be accessed from both web applications? Should I use a service or is there some other way?
Here are some related questions I found, but I don't think they cover my particular scenario:
How to handle file uploads to a dedicated image server?
How to upload a file to a WCF Service?
Upvotes: 4
Views: 3337
Reputation: 6143
Since both applications are on the same server this should be straightforward:
Upvotes: 4
Reputation: 30170
Assuming the file path you put in the DB is accessible from the non-admin web app (which it sounds like it is), the file just needs to go somewhere that both applications have access rights to. Only the admin app would need to have write access.
You can configure what user account an IIS web site will run under Website properties > Directory Security in the IIS management console. Then just make sure to set appropriate directory permissions.
Upvotes: 0
Reputation: 2183
You could setup a new virtual directory in each application that points to the same folder on your server where you would upload the files to. Lets say you created a new folder on your c: drive called "uploads" i.e. c:\uploads. Then in IIS setup a new virtual directory called "uploads" that points to c:\uploads for each web application. That should give both sites access to the files.
Upvotes: 2
Reputation: 704
Can I ask why you are not keeping the file in the DB? This would make passing it around much easier.
Upvotes: 0