我被困在上传文件中它在本地工作正常,但当我在服务器上部署它显示
500内部服务器错误..
这里我的代码请查看..哪里错了?
这是我的控制器代码
[HttpPost]
public ActionResult GlovalValues(Global_values REC, HttpPostedFileBase uploadFile)
{
string strPath = "~/Laptop_File/";
string Server_path = "";
string GetFileName = "";
int id = REC.ID;
string Desc = REC.GS_Desc;
string Name = REC.GS_Name;
string values = REC.GS_Values;
int Effrows = 0;
if (uploadFile != null && uploadFile.ContentLength > 0)
{
try
{
if (!Directory.Exists(Server.MapPath(strPath)))
{
DirectoryInfo di = Directory.CreateDirectory(Server.MapPath(strPath));
}
if (Request.Files.Count > 0)
{
var file = Request.Files[0];
var filePath = Request.FilePath;
var FileExtension = uploadFile.FileName.Substring(uploadFile.FileName.LastIndexOf('.') + 1).ToLower();
string ActualFileName = uploadFile.FileName;
GetFileName = Path.GetFileNameWithoutExtension(uploadFile.FileName);
if (file != null && file.ContentLength > 0)
{
string UploadFileName = Path.GetFileName(GetFileName + "." + FileExtension);
Server_path = Path.Combine(Server.MapPath("~/Laptop_File/"), UploadFileName);
if (FileExtension == "xlsx" || FileExtension == "xltx" || FileExtension == "xls" || FileExtension == "xlt ")
{
file.SaveAs(Server_path);
}
}
}
}
catch (Exception ex)
{
throw;
}
}
return RedirectToAction("Global_Values_List", "GS_Global_Values");
}

这是我的观点
@using (Html.BeginForm("GlovalValues", "GS_Global_Values", FormMethod.Post, new { @id = "id", @enctype = "multipart/form-data" }))
{
<div class="form-group">
<label> Uplaod File : </label>
<div class="col-md-10">
<input type="file" name="uploadFile" id="fileupload" />
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</div>
}
&#13;
请帮助我弄清楚什么是错的