上传表单如下:
|
||||||||||||||||||||||||
asp源代码:
| <html> <body> <title>文件上传</title> <center> </center> <% set obj = server.createobject(“yousoft.uploadfile”) response.write “总共上传 ” & obj.count & ” 个文件<br>总数据大小 ” & obj.totalbytes & ” bytes<br>共花费了时间 ” & (obj.spendtime/1000) & ” 秒<br>” response.write obj.version %> <hr> <table width=”75%” border=”1″> <tr> <td width=”20%”>标题:</td> <td width=”80%”><%=obj.form(“title1”)%></td> </tr> <tr> <td width=”20%”>属于:</td> <td width=”80%”><%=obj.form(“sel1”)%></td> </tr> <tr> <td width=”20%”>性别:</td> <td width=”80%”><%=obj.form(“sex1”)%></td> </tr> <tr> <td width=”20%”>分类:</td> <td width=”80%”><%=obj.form(“list1”)%></td> </tr> <tr> <td width=”20%”>内容: </td> <td width=”80%”><%=obj.form(“content1”)%></td> </tr> <tr> <td width=”20%”>是否选定:</td> <td width=”80%”><%=obj.form(“select1”)%></td> </tr> <tr> <td width=”20%”>提交按钮:</td> <td width=”80%”><%=obj.form(“save”)%></td> </tr> </table> <p> </p> <p>上传文件如下:<br> </p> <table border=”1″> <tr> <td nowrap>名称</td> <td nowrap>文件名(包括扩展名)</td> <td nowrap>文件名(不含扩展名)</td> <td nowrap>文件大小(b)</td> <td nowrap>原文件路径</td> <td nowrap>文件扩展名</td> <td nowrap>原文件名(含路径)</td> </tr> <%for i=0 to obj.count-1 %> <% userfile = obj.userfile(i) %> <tr> <td> <% =userfile %> </td> <td> <% =obj.filename(userfile) %> </td> <td> <% =obj.filenamex(userfile) %> </td> <td> <% =obj.filesize(userfile) %> </td> <td> <% =obj.filepath(userfile) %> </td> <td> <% =obj.fileext(userfile) %> </td> <td> <% =obj.oldfilename(userfile)%> </td> </tr> <% obj.savetoftp “192.168.7.168”,21,5000,”xu”,”xu”,0,””,0,””,userfile,obj.filename(userfile) %> <% obj.savefile userfile, “c:\” & obj.filename(userfile) %> <% obj.savefileas userfile, “c:\” & obj.filename(userfile) %> <% obj.savefileas “file6”, “c:\a.txt” %> <% =obj.getfiledata (userfile,”txt”) %> <% next set obj=nothing %> </table> <hr> </body> </html> |
上传结果:
| 总共上传 5 个文件 总数据大小 4317 bytes 共花费了时间 .321 秒 youupload 1.0版 版权所有(c)徐长友
上传文件如下:
|
以上使用了youupload上传组件,下面是youupload的介绍:
|
