无法上传附件,也无法下载文件

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文件</title>
<style type="text/css"> 
.printTable {
    font-size: 17px;
}
.printTable td {
    height: 40px;
    padding: 0 5px 0 5px;
    line-height: 25px;
}
.printTableNone td {
    border: none;
}
.printTitle {
    width: 100%;
    line-height: 40px;
    height: 55px;
    text-align: center;
    font-size: 20px;
    font-family: '黑体';
}
table {
    border-collapse:collapse;
}
table td {
    word-break:break-all;
}
.table {
    border-top: 1px solid #000000;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    border-left: 1px solid #000000;
}
.td  {
    border-top: 1px solid #000000;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    border-left: 1px solid #000000;
}
</style>
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../js/number.js"></script>
<script type="text/javascript" src="../js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="../js/required.js"></script>

<script>

     $(document).ready(function () {
        $("textarea[required='true']").each(function(){
            //alert($(this).attr("xmlName"));
            this.style.height=this.scrollHeight+'px';
        });
     }) 

        function fileBc(){
            var a = validate();
            if(a == true){
                a = uploadFile();
            }
            return a;
        }
        function uploadFile()
        {
            var valueFile=$('#qd').val();
            if(valueFile!=""){
                if(valueFile.split(".")[valueFile.split(".").length-1]!="zip"){
                    alert("文件上传后缀名有误,请选择后缀为zip的文件");
                    return  false;
                }else {
                    var file = valueFile.split("\\")[valueFile.split("\\").length-1];
                    var fileName = file.split(".")[0];
                    external.Upload(valueFile,'4028e4483f095068013f096df580000f\\4028e4483f095068013f096df580000f.zip');
                    $("#gclqd").html("下载");
                    $("#tbrbc7a257861114c658cae805e1d6ad233").val(fileName+".zip");
                }
            }
            return true;
        }
        function hidde_file(){
          var fileName = $('#lqd').val();
          $('#tbrbc7a257861114c658cae805e1d6ad233').val(fileName);
        }
        $(document).ready(function(){
           $('#deleteID').click(function(){
                $('#qd').replaceWith($('#qd').clone());
                $('#gclqd').html('');
                $('#tbrbc7a257861114c658cae805e1d6ad233').val('');
           });
           $('#gclqdhref').click(function(){
                var valueFile=$('#qd').val();
                var fileName = valueFile.split("\\")[valueFile.split("\\").length-1];
                external.DownLoad('4028e4483f095068013f096df580000f\\4028e4483f095068013f096df580000f.zip');
          });
           $('.chooseFile').click(function(){
              $('.hidde_file').trigger('click');
           });
        });
</script>

</head>

<body>
<div style="width:1000px; margin:0 auto; padding:20px 0 0 0;">
<table class=printTable border=0 cellSpacing=0 cellPadding=0 width="100%">

<#list List as bd>
          <#assign bdId="${bdId}"/>
        
        <#assign allBdId=allBdId+"|"+bdId/>
       
     <tbody id="show_${bdId}" style="display:block">

<tr>
    <td colspan="4" align="left">
        <table width="100%" border="1" align="left" class="table">
  <tr>
    
    <td width="13%" align="center" class="td"><p >aaa</p></td>
  </tr>
      <#list List as Wz>    
        <#if Id==bdId>
  <tr>
        <td class="td" align="center"><span id="zj${Id}"></span><input type="hidden" id="sl${Id}" value="${Sl}"/></td>
  </tr>
        </#if>
  </#list>
</table>    </td>
</tr></tbody>
  </#list>

<tr>
    <td colspan="4"><p>&nbsp;</p>
      <p>
          附件:<input name="qd" id="qd" class="hidde_file" type="file"  size="50" style="position:absolute;top:3px;left:135px;height:22px;width:220px;overflow:hidden;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;cursor:pointer;z-index:100;" onchange="hidde_file();"/>
       <input type="text" xmlType="text" pageId="8a8a8a8449e97a2d014a146129dd2807" groupId="" class="single_input" xmlId="bc7a257861114c658cae805e1d6ad238" xmlDId="80DC683B754642A7B8B4D7416C5D561B" xmlName="文件路径" xmlIndex="" xmlRole="" parentId="" id="tbrbc7a257861114c658cae805e1d6ad238" value="" style="width:300px;border:none; border-bottom:1px solid #000000;" required="false"/> 
       <a href="javascript:;" class="opt_btn chooseFile">选择文件</a>
       <a href="#" id="gclqdhref")"><span id="gclqd" xmlName="附件" required=""></span></a>&nbsp;<a href="javascript:;" id="deleteID" name="deleteName" isShow="yn" >删除</a>
      </p>
      <br/>
     </p></td>
</tr>
</table>
</div>
</body>
</html>

我想问怎么加上传成功的提示,大文件为啥上传不了。下载的时候也下载不下来。

谢谢各位大神

 external.Upload(valueFile,'4028e4483f095068013f096df580000f\\4028e4483f095068013f096df580000f.zip');

这个写法有问题吧,你得到的是文件名称,根本没有上传文件。

你的上传代码做分片处理了吗?没做分片处理整个文件传一般服务器有上传大小限制的,如asp默认是200kb,asp.net是4M,php好像是8M,其他语言不太了解,应该也会有限制。

如果上传文件超过默认的大小限制会报错的,需要修改过默认的上传大小才行。自己找下你使用的服务器语言或者服务器,修改下上传的默认大小,改成1GB什么的

 

而且看你代码有导入external这上传下载的js库了吗?

  

您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632