上传表单如下:
|
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的介绍:
|