set upload=new upfile_class ''建立上传对象
upload.GetData(104857600) '取得上传数据,限制最大上传100M
if upload.err > 0 then '如果出错
select case upload.err
case 1
response.write "请先选择你要上传的文件!"
case 2
response.write "你上传的文件总大小超出了最大限制(1M)"
end select
response.end
end if
如果文件大小单位为K
代码:
double kbytes = (double)fileupload.PostedFile.ContentLength / 1024;
简单
HttpFileCollection hc = Request.Files;
for (int i = 0; i < hc.Count; i++)
{
FileInfo fi = new FileInfo(hc[i].FileName);
//文件大小fi.Length;
FileSaveName = fi.Name+ fi.Extension;
hc[i].SaveAs(fullpath + FileSaveName);
}
这里有一个获取文件大小的文件上传
你可以试试