在MVC3应用程序中上传文件 [英] File uploading in MVC3 Applications

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

问题描述

我喜欢在mvc3应用程序中使用文件上传器上传文件。我得到文件的路径为C:\ fakepath \ filename.jpg。如何获得完整的路径。通过一些例子来帮助我。

I like to upload a file using file uploader in mvc3 application. I am getting the path of the file as "C:\fakepath\filename.jpg". How to get the full path.Kindly help me for the same with some example.

推荐答案

请参考以下链接



http:// www。 mindstick.com/Articles/2f001c1c-daea-4fa7-856d-7c72a1883508/?FileUpload%20in%20ASP.NET%20MVC [ ^ ]
Please refer the following link

http://www.mindstick.com/Articles/2f001c1c-daea-4fa7-856d-7c72a1883508/?FileUpload%20in%20ASP.NET%20MVC[^]


你有没有试试......〜/ file_address / filename.jpg或../file_address/filename.jpg?而且,记住你需要将文件添加到项目中,以便它可以从它自己的内容而不是从你的计算机中调用它。您可以通过右键单击解决方案资源管理器中的图像并添加现有文件来执行此操作。
Did you try..."~/file_address/filename.jpg" or "../file_address/filename.jpg"? And also, rememeber you need to add the file to the project so it can call it from it's own content and not from your computer. You can do that by right-clicking on Images in your solution explorer and add existent file.


这篇关于在MVC3应用程序中上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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