IT码农库

您当前所在位置:首页 > 网络编程 > 编程10000问

编程10000问

如何限制上传文件的大小?

网络 2006-11-16编程10000问5199
 <%@ LANGUAGE="VBscript" %>      <html><head>      <title>撼雪喷云之限传文件</title>      </head>      <body>      <% Set upl = Ser...

 <%@ LANGUAGE="VBscript" %>
      <html>

<head>
      <title>
撼雪喷云之限传文件</title>
      </head>
      <body>
      <% Set upl = Server.CreateObject("SoftArtisans.FileUp") %>
      <% upl.MaxBytes = 1000

 ' 限制最大尺寸1000字节.
 %>
     
特别提醒:每一个上传文件最大不超过.

<%=upl.MaxBytes%>字节.<br>
      <% upl.SaveAs "C:\intels\temp\upload.out" %>
     
总计写入字节数: <%=upl.TotalBytes%><br>
     
服务器文件名: <%=upl.ServerName%><br>
     
你发送的总字节数: <%=Request.TotalBytes%>
      </body></html>
 
这样,所有第1000个字节以后的内容都会被丢弃,限制了文件大小,拉开了不同会员等级之间的差距。

 

[1]

大图广告(830*140)