| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1307 人关注过本帖
标题:已经解诀(可以看看这个解诀办法,真是让人想不到)
只看楼主 加入收藏
lili0610931
Rank: 1
等 级:新手上路
帖 子:133
专家分:0
注 册:2007-7-6
收藏
 问题点数:0 回复次数:4 
已经解诀(可以看看这个解诀办法,真是让人想不到)
<!--#include file="upload.inc"-->

<html>
<head>
<title>文件上传</title>
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    background-color: #EEFFEE;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body>

<script>
parent.document.forms[0].Submit.disabled=false;
</script>
<%
dim upload,file,formName,formPath,iCount,filename,fileExt
set upload=new upload_5xSoft ''建立上传对象

 formPath=upload.form("filepath")
 ''在目录后加(/)
 if right(formPath,1)<>"/" then formPath=formPath&"/"
response.write "<body>"

iCount=0
for each formName in upload.file ''列出所有上传了的文件
 set file=upload.file(formName)  ''生成一个文件对象
 if file.filesize<6144 then
     response.write "请选择你要上传的音乐 [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
    response.end
 end if
     
 if file.filesize>6144*1000 then
     response.write "音乐大小超过了限制6M [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
    response.end
 end if

 fileExt=lcase(right(file.filename,4))
 uploadsuc=false
Forum_upload="mp3,wav,wma"
 Forumupload=split(Forum_upload,",")
 for i=0 to ubound(Forumupload)
    if fileEXT="."&trim(Forumupload(i)) then
    uploadsuc=true
    exit for
    else
    uploadsuc=false
    end if
 next
 if uploadsuc=false then
     response.write "音乐格式不正确 [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
    response.end
 end if

 randomize
 ranNum=int(90000*rnd)+10000
 FileName=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&fileExt

 if file.FileSize>0 then         ''如果 FileSize > 0 说明有文件数据
  file.SaveAs Server.mappath(FileName)   ''保存文件
    for i=0 to ubound(Forumupload)
        if fileEXT="."&trim(Forumupload(i)) then
         response.write "<script>parent.form1.musicnm.value+='"&FileName&"'</script>"
        exit for
        end if
    next
 iCount=iCount+1
 end if
 set file=nothing
next
set upload=nothing  ''删除此对象

Htmend iCount&" 个文件上传结束!"

sub HtmEnd(Msg)
 set upload=nothing

 response.write "上传成功"
 response.end
end sub

%>


看看为什么上传在500K的时候文件可以
上传超过500K就不可以了
我设置的是6M啊(

[[it] 本帖最后由 lili0610931 于 2008-5-9 11:20 编辑 [/it]]
搜索更多相关主题的帖子: 解诀 upload 办法 body 
2008-05-09 10:40
lili0610931
Rank: 1
等 级:新手上路
帖 子:133
专家分:0
注 册:2007-7-6
收藏
得分:0 
已经解诀.因为2003的系统只能上传200K以下的文件
所以不能上传,改了之后就可以了
呵呵
跟你们说一下怎么改得吧
高兴的可以看一下.
1.停止IIS Admin Service服务。

2.按照如下的路径找到文件:系统盘(C:)>> Windows >> System32 >> inetsrv  >> MetaBase.xml, 在该文件中搜索AspMaxRequestEntityAllowed,设置为你想要的数字(默认204800即200K)。

3.重新启动IIS Admin Service服务。

方法二:

1.复制以下代码到记事本中:

'use VBS
set obj1=GetObject("winmgmts:/root/MicrosoftIISv2")
set obj2=obj1.get("IIsWebVirtualDirSetting='W3SVC/1/ROOT'")
'Output default value
WScript.Echo "AspMaxRequestEntityAllowed Default Value: " & obj2.AspMaxRequestEntityAllowed
'Reset the value
obj2.AspMaxRequestEntityAllowed=1000000000 ' set to 1mbyte, u can set to other what you want :)
' Save data
obj2.Put_()
'Output new value
WScript.Echo "AspMaxRequestEntityAllowed New Value: " & obj2.AspMaxRequestEntityAllowed

保存为requestchange.vbs(假设我们保存在D盘根目录下)

2.打开命令窗口,输入cscript  D:\requestchange.vbs, 回车即可。

注:上述方法经过本人测试有效,但是存在一个问题,上传25M的文件没有问题,上传40M就出问题了。所以具体在使用时还要自己测试一下。如果各位高人有更好的办法,还请不吝赐教!谢了!
收到的鲜花
  • 永夜的极光2008-05-09 11:26 送鲜花  8朵   附言:我很赞同
2008-05-09 11:19
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
收藏
得分:0 
方法不错
但是个人认为过大的文件不适合用无组件上传,直接ftp就可以了,上传的太慢,没那个必要。
2008-05-09 12:20
lili0610931
Rank: 1
等 级:新手上路
帖 子:133
专家分:0
注 册:2007-7-6
收藏
得分:0 
你没有看过,看过之后就知道了,算了,我还要去改一个呢?不说了,做程序去了
2008-05-09 13:05
快速回复:已经解诀(可以看看这个解诀办法,真是让人想不到)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017839 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved