阿赛文件上传V1.0怎么用? 我下载过来放进去用不起来啊~~~谁帮个忙啊!!

阿赛文件上传V1.0怎么用? 我下载过来放进去用不起来啊~~~谁帮个忙啊!!,第1张

最简单,容易看懂的ASP上传文件程序木目,ASP文件上传

<%

Response.Buffer = True

Server.ScriptTimeOut=9999999

On Error Resume Next

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />

<meta http-equiv="Content-Language" content="zh-cn" />

<meta content="all" name="robots" />

<meta name="author" content="木目,Woodeye" />

<meta name="description" content="最简单,容易看懂的ASP上传文件程序木目,ASP文件上传&lt% Response.Buffer = True Server.ScriptTimeOut=9999999 On Error Resume Next%&gt" />

<meta name="keywords" content="文件上传,功能,智能手机,上传文件,企业网站" />

<style type="text/css">

<!--

body,input {font-size:12px}

-->

</style>

<title>木目ASP文件上传工具</title>

</head>

<body id="body">

<%

ExtName = "jpg,gif,png,txt,rar,zip,doc,asp"'允许扩展名

SavePath = "upload" '保存路径

If Right(SavePath,1)<>"/" Then SavePath=SavePath&"/" '在目录后加(/)

CheckAndCreateFolder(SavePath)

UpLoadAll_a = Request.TotalBytes '取得客户端全部内容

If(UpLoadAll_a>0) Then

Set UploadStream_c = Server.CreateObject("ADODB.Stream")

UploadStream_c.Type = 1

UploadStream_c.Open

UploadStream_c.Write Request.BinaryRead(UpLoadAll_a)

UploadStream_c.Position = 0

FormDataAll_d = UploadStream_c.Read

CrLf_e = chrB(13)&chrB(10)

FormStart_f = InStrB(FormDataAll_d,CrLf_e)

FormEnd_g = InStrB(FormStart_f+1,FormDataAll_d,CrLf_e)

Set FormStream_h = Server.Createobject("ADODB.Stream")

FormStream_h.Type = 1

FormStream_h.Open

UploadStream_c.Position = FormStart_f + 1

UploadStream_c.CopyTo FormStream_h,FormEnd_g-FormStart_f-3

FormStream_h.Position = 0

FormStream_h.Type = 2

FormStream_h.CharSet = "GB2312"

FormStreamText_i = FormStream_h.Readtext

FormStream_h.Close

FileName_j = Mid(FormStreamText_i,InstrRev(FormStreamText_i,"\")+1,FormEnd_g)

If(CheckFileExt(FileName_j,ExtName)) Then

SaveFile = Server.MapPath(SavePath &FileName_j)

If Err Then

Response.Write "文件上传: <span style=""color:red"">文件上传出错!</span><a href=""" &Request.ServerVariables("URL") &""">重新上传文件</a><br />"

Err.Clear

Else

SaveFile = CheckFileExists(SaveFile)

k=Instrb(FormDataAll_d,CrLf_e&CrLf_e)+4

l=Instrb(k+1,FormDataAll_d,leftB(FormDataAll_d,FormStart_f-1))-k-2

FormStream_h.Type=1

FormStream_h.Open

UploadStream_c.Position=k-1

UploadStream_c.CopyTo FormStream_h,l

FormStream_h.SaveToFile SaveFile,2

SaveFileName = Mid(SaveFile,InstrRev(SaveFile,"\")+1)

Response.write "文件上传: <span style=""color:red"">" &SaveFileName &" </span>文件上传成功! <a href=""" &Request.ServerVariables("URL") &""">继续上传文件</a><br />"

End If

Else

Response.write "文件上传: <span style=""color:red"">文件格式不正确!</span><a href=""" &Request.ServerVariables("URL") &""">重新上传文件</a><br />"

End If

Else

%>

<script language="Javascript">

<!--

function ValidInput()

{

if(document.upform.upfile.value=="")

{

alert("请选择上传文件!")

document.upform.upfile.focus()

return false

}

return true

}

// -->

</script>

<form action='<%= Request.ServerVariables("URL") %>' method='post' name="upform" onsubmit="return ValidInput()" enctype="multipart/form-data">

文件上传:

<input type='file' name='upfile' size="40"><input type='submit' value="上传">

</form>

<%

End if

Set FormStream_h = Nothing

UploadStream.Close

Set UploadStream = Nothing

%>

</body>

</html>

<%

'判断文件类型是否合格

Function CheckFileExt(FileName,ExtName) '文件名,允许上传文件类型

FileType = ExtName

FileType = Split(FileType,",")

For i = 0 To Ubound(FileType)

If LCase(Right(FileName,3)) = LCase(FileType(i)) then

CheckFileExt = True

Exit Function

Else

CheckFileExt = False

End if

Next

End Function

'检查上传文件夹是否存在,不存在则创建文件夹

Function CheckAndCreateFolder(FolderName)

fldr = Server.Mappath(FolderName)

Set fso = CreateObject("Scripting.FileSystemObject")

If Not fso.FolderExists(fldr) Then

fso.CreateFolder(fldr)

End If

Set fso = Nothing

End Function

'检查文件是否存在,重命名存在文件

Function CheckFileExists(FileName)

Set fso=Server.CreateObject("Scripting.FileSystemObject")

If fso.FileExists(SaveFile) Then

i=1

msg=True

Do While msg

CheckFileExists = Replace(SaveFile,Right(SaveFile,4),"_" &i &Right(SaveFile,4))

If not fso.FileExists(CheckFileExists) Then

msg=False

End If

i=i+1

Loop

Else

CheckFileExists = FileName

End If

Set fso=Nothing

End Function

%>

-------------刚接触上传文件程序的时候,我就是从这个文件获得启发,希望也能帮助你

挑选几个经典的:

1、阿赛企业网站系统

2、凡诺企业网站管理系统

3、锐智企业建站系统

4、凡人网络购物系统

5、ASPCMS

6、汇成企业网站管理系统

7、刀客建站系统

8、CmsEasy

9、Companyweb整站系统

1.基本通讯功能,打电话、发短信。这些是手机的基础功能此项功能必须实现,否则就不是手机了。

2.娱乐功能。包含了相机、收音机、媒体播放器、游戏等主要丰富我们的日常生活。为什么收音机不是通讯功能,因为它只是一个接受过程,不包含发送功能。

3.智能机最大的进步是它结合了手机、音视频播放及其它个人数据处理的几乎所有的服务。智能手机的出现使得大多数用户不用再带很多其它的设备就可以完成想做的事情。

4.智能手机的软件、用户界面和功能机不同。功能手机安装的是软件,智能手机都有高性能的处理器,智能手机更像桌面微型电脑。智能手机更加地个性化,智能机大多都是触屏的,当用户想输入东西时,键盘就会自动出来 。

5.应用及功能不同。智能手机最大的一个特点是它可以安装应用。这些应用可以提供各种各样的功能,如游戏、地图、娱乐、导航、新闻、天气预报等等。有了这些应用,智能手机的功能就大大扩展了,有些应用是付费的,不过也有很多是免费的。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/tougao/12018308.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-20
下一篇2023-05-20

发表评论

登录后才能评论

评论列表(0条)

    保存