如何上传文件到IIS虚拟目录

如何上传文件到IIS虚拟目录

本文介绍了如何上传文件到IIS虚拟目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个需要上传文件的.NET应用程序。我有presentation,服务层和数据层。文件被提交在presentation层(MVC),然后保存的数据层。目前我将文件保存到文件系统 - C:\ SomeDirectory,但我需要保存它Plesk所管理IIS中的虚拟目录中。有没有人遇到任何资源,解释如何保存在IIS文件到虚拟目录?

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?

感谢您!

推荐答案

没有什么不好保存到一个虚拟目录本身,但它是不是真的意味着这一点。储蓄最好的办法是尝试让虚拟目录的绝对路径(如果外面你的网站根目录),如果在所有可能的。

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.

这篇关于如何上传文件到IIS虚拟目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 19:08