如何使用MVC上传文件 [英] How to upload a file with mvc

查看:68
本文介绍了如何使用MVC上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

还有其他方法可以使用c#将文件上传到控制器中吗?

如果目录已准备就绪,我会使用创建目录的C#代码在末尾附加一个随机数.我需要捕获新创建的目录文件名,并在提交时将文件上传到该目录.

Is there any other way to do file uploads with c# other place the code in controller.

I have c# code that create directories attach a random number at the end if directory all ready exist. I need to capture the new created directory file name and up files to that directory on submit.

推荐答案

阅读以下内容:

使用ASP.NET MVC实现HTTP文件上传 [ ^ ]

uploading-files-with-aspnetmvc [
Read these:

Implementing HTTP File Upload with ASP.NET MVC[^]

uploading-files-with-aspnetmvc[^]

hope it helps :)


最佳示例:
http://towardsnext.wordpress.com/2009/04/17/file -upload-in-aspnet-mvc/ [ http://stackoverflow.com/questions/5193842/file-upload-asp-net- mvc3-0 [ ^ ]
best examples:
http://towardsnext.wordpress.com/2009/04/17/file-upload-in-aspnet-mvc/[^]

http://stackoverflow.com/questions/5193842/file-upload-asp-net-mvc3-0[^]


尝试一下

http://www.c-sharpcorner.com/uploadfile /dhananjaycoder/file-upload-in-Asp-Net-mvc-application/ [
Try this

http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/file-upload-in-Asp-Net-mvc-application/[^]


这篇关于如何使用MVC上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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