user338195
user338195

Reputation:

How to upload files to IIS Virtual Directory?

I'm writing a .NET application that needs to upload files. I have presentation, service and data layers. Files get submitted in the Presentation layer (MVC), and then saved by the Data layer. Currently I'm saving files to the file system - C:\SomeDirectory, but I need to save them within the virtual directory in IIS which is managed by Plesk. Did anybody come across any resources explaining how to save files to the virtual directory in IIS?

Should I be uploading files to virtual directory at all?

Thank you!

Upvotes: 1

Views: 4241

Answers (1)

Francis Gilbert
Francis Gilbert

Reputation: 3442

There isn't anything wrong with saving to a virtual directory as such, but it isn't really meant for that. The best way of saving is to try to get the absolute path of the virtual directory (if outside your site root) if at all possible.

Upvotes: 1

Related Questions