日期:2014-05-17  浏览次数:20905 次

关于LyfUpload组件上传文件的问题,详情请进
下面我只截取主要片段
/*页面up_book.asp   */
<form   name= "up_book "   id= "up_book "   action= "addbook.asp "   method= "post "   onsubmit= "return   check();return   false; ">
封面: <input   name= "cover1 "   type= "text "   />
                    <input   name= "cover "   type= "button "   id= "cover "   onClick= "javascript:window.open( 'upload.asp?fname=cover1 ', ' ', 'toolbar=no,   status=no,   menubar=no,   resizable=yes,   scrollbars=no,width=300,height=100,top=200,left=300 '); "   value= "添加 "/> <br   />
附件: <input   name= "attachment1 "   type= "text "   />
                    <input   name= "attachment "   type= "button "   id= "attachment "   onclick= "javascript:window.open( 'upload.asp?fname=attachment1 ', ' ', 'toolbar=no,   status=no,   menubar=no,   resizable=yes,   scrollbars=no,width=300,height=100,top=200,left=300 '); "   value= "添加 "/>
<input   type= "submit "   name= "Submit "   value= "上传 "   />
</form>

/*页面upload.asp   */
<HTML>
<HEAD>
<META   NAME= "GENERATOR "   Content= "Microsoft   Visual   Studio   6.0 ">
<TITLE> 文件上传 </TITLE>
<SCRIPT   ID=clientEventHandlersJS   LANGUAGE=javascript>
<!--
  function   submit1_onclick()  
  {        
         
          document.frm.filenum.value=document.frm.file1.value;
         
  }
-->
</SCRIPT>
</HEAD>
<BODY>
<form   name= "frm "   method= "post "   enctype= "multipart/form-data "   action= "demo2.asp?fname= <%=request( "fname ")%> ">
    <input   id= "file1 "   type= "file "   name= "file1 "   >
    <input   type= "hidden "   name= "filenum "   >
    <p>
        <INPUT   type= "submit "   value= "   上   传   "   name= "Submit "   id=submit1   LANGUAGE=javascript   onClick= "return   submit1_onclick() ">
        <input   type= "reset "     value= "   重   写   "   name= "reset "     >        
    </p>
</form>
</BODY>
</HTML>

/*页面demo2.asp   */
Set   obj=Server.CreateObject( "LyfUpload.UploadFile ")
dim   oldname
oldname=obj.Request( "filenum ")
<script   language= "javascript ">
var   temp;
fname= ' <%=obj.request( "fname ")%> '★★★★★
opener.up_book.fname.value= ' <%=xdlj%> ';
window.close();
</s