mvc 5中的文件上传错误 [英] error in file upload in mvc 5

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

问题描述

大家好,

这里我在我的本地IIS中部署我的项目。当我点击文件上传时我得到以下错误。



{success:false,错误:文件上传失败:无法找到路径的一部分\ u0027F:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\在host.xlsx \ u0027中的\\ExcelFiles \\testbranchmodule。}



编码文件路径在我的控制器中,带有表单标记:

hi to all,
Here i deploy my project in my local IIS.When i click for file upload i got below error.

{"success":false,"Error":"File Upload failed :Could not find a part of the path \u0027F:\\troyerp\\troyerp\\troyerp\\App_Data\\ExcelFiles\\testbranchmodule in host.xlsx\u0027."}

In coding file path is in my controller with in form tag:

if (fileExtension == ".xls" || fileExtension == ".xlsx")
               {
                   string fileLocation = string.Format("{0}/{1}, Server.MapPath("~/App_Data/ExcelFiles"), fileName);





如何解决此任务。



how to i resolve for this task.

推荐答案

你可以用View共享代码并完成控制器操作吗?
can u share the code with View and complete controller actions ?


这篇关于mvc 5中的文件上传错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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