问题描述
MVC写的一个系统,上传文件功能每次本地测试均能正常运行,放到服务器都失败,我试过修改server文件夹权限,还是不行,也许是我修改的不对,代码量有些大不方便贴,求高手意见,如若必要贴出关键代码。小弟初入职,还望不吝赐教啊。
解决方案
解决方案二:
贴异常内容stacktrace
解决方案三:
不贴出错,怎么搞?
解决方案四:
代码奉上:这是JS写的上传文件代码,后台Controller有相应处理函数,本地测试无问题,放到服务器一直停在最后一个else,不解啊functiontoFileUploadPage(eRFQNo,pagefrom,filefrom){varfilename=document.getElementById("file").value;if(filename!=""){if(pagefrom=="C"){$.post('@Url.Action("FileUpload","FileOperation")',{file:filename,pagefrom:"C",time:newDate().getTime()},function(data){if(data.indexOf("failed")<0){if(data.indexOf("existed")<0){varfilearrar=data.split(',');vartrobj=document.createElement('tr');trobj.align="left";trobj.id="tr"+filearrar[2];vartdmatrialNoobj=document.createElement('td');varamatrialNoobj=document.createElement('A');amatrialNoobj.id="filename";amatrialNoobj.innerHTML=filearrar[0];tdmatrialNoobj.appendChild(amatrialNoobj);vartdmpnNoobj=document.createElement('td');varampnNoobj=document.createElement('A');ampnNoobj.id="filesize";ampnNoobj.innerHTML=filearrar[1]+".00";tdmpnNoobj.appendChild(ampnNoobj);vartdmfctobj=document.createElement('td');varamfctobj=document.createElement('A');amfctobj.id="createdate";amfctobj.innerHTML=filearrar[7];tdmfctobj.appendChild(amfctobj);vartdmmnoobj=document.createElement('td');varammnoobj=document.createElement('A');ammnoobj.id="erfqno";ammnoobj.innerHTML=filearrar[4];tdmmnoobj.appendChild(ammnoobj);vartddscrpobj=document.createElement('td');varadscrpobj=document.createElement('A');adscrpobj.id="uploadedby";adscrpobj.innerHTML=filearrar[3];tddscrpobj.appendChild(adscrpobj);vartdordntobj=document.createElement('td');varaordntobj=document.createElement('A');aordntobj.id="filefrom";aordntobj.innerHTML=filearrar[6];tdordntobj.appendChild(aordntobj);vartdbntobj=document.createElement('td');vardivobj=document.createElement('div');varbtdeleteobj=document.createElement('input');btdeleteobj.setAttribute("type","button");btdeleteobj.id="btdelete";btdeleteobj.title="@Resources.FileOperationResource.TooltipDlt";btdeleteobj.style.background="url('../Content/Image/Trash24.png')no-repeatcenter";btdeleteobj.style.width="30px";btdeleteobj.style.height="30px";vardeletefun=function(num1,num2,num3){returnfunction(){ShowConfirmMsg(num1,num2,num3)}}//btdeleteobj.attachEvent("onclick",deletefun(filearrar[2],filearrar[0]));btdeleteobj.attachEvent("onclick",deletefun("@Resources.FileOperationResource.JsConfirmAlertDltFile",filearrar[2],filearrar[0]));//divobj.appendChild(btdownloadobj);divobj.appendChild(btdeleteobj);tdbntobj.appendChild(divobj);trobj.appendChild(tdmatrialNoobj);trobj.appendChild(tdmpnNoobj);trobj.appendChild(tdmfctobj);trobj.appendChild(tdmmnoobj);trobj.appendChild(tddscrpobj);trobj.appendChild(tdordntobj);trobj.appendChild(tdbntobj);filetbody.appendChild(trobj);//reinitIframe();ShowAlertMsg("@Resources.BuyerResource.ToolTipCFS");}else{ShowAlertMsg('@Resources.FileOperationResource.JsAlertFileExist');}}else{ShowAlertMsg("@Resources.BuyerResource.ToolTipCFF");}});}