从目录ASP.NET MVC上载文件 [英] Upload Files From a Directory ASP.NET MVC

查看:89
本文介绍了从目录ASP.NET MVC上载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。


我想从目录上传文件,我想要上传目录中的所有文件。该目录存储在一个字符串变量中,并希望将其存储/上传到Request.File中,以便我可以评估已上传的文件。


目前,我能够获取文件路径使用Directory.GetFiles方法。


它是一个mvc应用程序,我想处理控制器端的所有内容。视图上唯一的输入标记应该是一个文本框,您可以在其中粘贴目录。


可以在不使用文件输入标记的情况下实现Request.File,只需使用字符串目录作为替换?


任何人?

解决方案

ASP.NET MVC论坛
http://forums.asp.net/1146.aspx
是提出此类问题的最佳地点

Hello everybody

I wanted to upload files from a directory and i want all of the files in the directory uploaded. The directory is stored on a string variable and wanted to store/upload it into a Request.File so that i can evaluate the file thats been uploaded.

Currently, im able to get the filepaths using Directory.GetFiles method.

Its an mvc app and i want to process everything on the controller side. The only input tag on the view should be a textbox wherein you can paste the directory.

Can Request.File be achieved without using a File Input Tag and just use a string directory as a replacement?

Anyone?

解决方案

The ASP.NET MVC forums http://forums.asp.net/1146.aspxis the better place for such questions


这篇关于从目录ASP.NET MVC上载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆