ASP上传图片代码,最简单的

作者&投稿:重态 (若有异议请与网页底部的电邮联系)
asp上传单个图片的最简单代码是什么?~

需要三个文件:
第一个(upload.asp)






图片上传






图片上传:








文件格式为*.gif,*.jpg,*.jpeg







第二个文件(uploadsave.asp)







图片上传






<%
set upload=new upload_5xsoft
set file=upload.file("file1")
if file.fileSize>0 then
'自动生成文件名
filename=date()
filename=filename&time()
filename=replace(filename,"-","")
filename=replace(filename,":","")
filename=replace(filename," ","")
filename=filename+"."
filenameend=file.filename
filenameend=split(filenameend,".")
if filenameend(1)="gif" or filenameend(1)="jpg" or filenameend(1)="jpeg" then
filename=filename&filenameend(1)
file.saveAs Server.mappath("uppic/"&filename)
response.write ""
response.write "图片已成功上传至服务器中,请使用下面红色地址添加图片,点击这里重新上传图片!"
response.write ""
response.write ""
response.write ""
response.write "asjobcom/uppic/"&filename
response.write ""
response.write ""
response.write "点击这里查看上传的图片"
response.write ""
response.write "【关闭窗口】"
else
response.write "文件格式不对"
response.write "返回"
end if
set file=nothing
else
response.write "文件内容不能为空"
response.write "返回"
end if
set upload=nothing
response.write ""
%>
最后一个(upload_asjob.asp)




dim upfile_5xSoft_Stream

Class upload_5xSoft

dim Form,File,Version

Private Sub Class_Initialize
dim iStart,iFileNameStart,iFileNameEnd,iEnd,vbEnter,iFormStart,iFormEnd,theFile
dim strDiv,mFormName,mFormValue,mFileName,mFileSize,mFilePath,iDivLen,mStr
Version="化境编程界HTTP上传程序 Version 1.0"
if Request.TotalBytes<1 then Exit Sub
set Form=CreateObject("Scripting.Dictionary")
set File=CreateObject("Scripting.Dictionary")
set upfile_5xSoft_Stream=CreateObject("Adodb.Stream")
upfile_5xSoft_Stream.mode=3
upfile_5xSoft_Stream.type=1
upfile_5xSoft_Stream.open
upfile_5xSoft_Stream.write Request.BinaryRead(Request.TotalBytes)

vbEnter=Chr(13)&Chr(10)
iDivLen=inString(1,vbEnter)+1
strDiv=subString(1,iDivLen)
iFormStart=iDivLen
iFormEnd=inString(iformStart,strDiv)-1
while iFormStart < iFormEnd
iStart=inString(iFormStart,"name=""")
iEnd=inString(iStart+6,"""")
mFormName=subString(iStart+6,iEnd-iStart-6)
iFileNameStart=inString(iEnd+1,"filename=""")
if iFileNameStart>0 and iFileNameStart<iFormEnd then
iFileNameEnd=inString(iFileNameStart+10,"""")
mFileName=subString(iFileNameStart+10,iFileNameEnd-iFileNameStart-10)
iStart=inString(iFileNameEnd+1,vbEnter&vbEnter)
iEnd=inString(iStart+4,vbEnter&strDiv)
if iEnd>iStart then
mFileSize=iEnd-iStart-4
else
mFileSize=0
end if
set theFile=new FileInfo
theFile.FileName=getFileName(mFileName)
theFile.FilePath=getFilePath(mFileName)
theFile.FileSize=mFileSize
theFile.FileStart=iStart+4
theFile.FormName=FormName
file.add mFormName,theFile
else
iStart=inString(iEnd+1,vbEnter&vbEnter)
iEnd=inString(iStart+4,vbEnter&strDiv)

if iEnd>iStart then
mFormValue=subString(iStart+4,iEnd-iStart-4)
else
mFormValue=""
end if
form.Add mFormName,mFormValue
end if

iFormStart=iformEnd+iDivLen
iFormEnd=inString(iformStart,strDiv)-1
wend
End Sub

Private Function subString(theStart,theLen)
dim i,c,stemp
upfile_5xSoft_Stream.Position=theStart-1
stemp=""
for i=1 to theLen
if upfile_5xSoft_Stream.EOS then Exit for
c=ascB(upfile_5xSoft_Stream.Read(1))
If c > 127 Then
if upfile_5xSoft_Stream.EOS then Exit for
stemp=stemp&Chr(AscW(ChrB(AscB(upfile_5xSoft_Stream.Read(1)))&ChrB(c)))
i=i+1
else
stemp=stemp&Chr(c)
End If
Next
subString=stemp
End function

Private Function inString(theStart,varStr)
dim i,j,bt,theLen,str
InString=0
Str=toByte(varStr)
theLen=LenB(Str)
for i=theStart to upfile_5xSoft_Stream.Size-theLen
if i>upfile_5xSoft_Stream.size then exit Function
upfile_5xSoft_Stream.Position=i-1
if AscB(upfile_5xSoft_Stream.Read(1))=AscB(midB(Str,1)) then
InString=i
for j=2 to theLen
if upfile_5xSoft_Stream.EOS then
inString=0
Exit for
end if
if AscB(upfile_5xSoft_Stream.Read(1))AscB(MidB(Str,j,1)) then
InString=0
Exit For
end if
next
if InString0 then Exit Function
end if
next
End Function

Private Sub Class_Terminate
form.RemoveAll
file.RemoveAll
set form=nothing
set file=nothing
upfile_5xSoft_Stream.close
set upfile_5xSoft_Stream=nothing
End Sub


Private function GetFilePath(FullPath)
If FullPath "" Then
GetFilePath = left(FullPath,InStrRev(FullPath, "\"))
Else
GetFilePath = ""
End If
End function

Private function GetFileName(FullPath)
If FullPath "" Then
GetFileName = mid(FullPath,InStrRev(FullPath, "\")+1)
Else
GetFileName = ""
End If
End function

Private function toByte(Str)
dim i,iCode,c,iLow,iHigh
toByte=""
For i=1 To Len(Str)
c=mid(Str,i,1)
iCode =Asc(c)
If iCode<0 Then iCode = iCode + 65535
If iCode>255 Then
iLow = Left(Hex(Asc(c)),2)
iHigh =Right(Hex(Asc(c)),2)
toByte = toByte & chrB("&H"&iLow) & chrB("&H"&iHigh)
Else
toByte = toByte & chrB(AscB(c))
End If
Next
End function
End Class


Class FileInfo
dim FormName,FileName,FilePath,FileSize,FileStart
Private Sub Class_Initialize
FileName = ""
FilePath = ""
FileSize = 0
FileStart= 0
FormName = ""
End Sub

Public function SaveAs(FullPath)
dim dr,ErrorChar,i
SaveAs=1
if trim(fullpath)="" or FileSize=0 or FileStart=0 or FileName="" then exit function
if FileStart=0 or right(fullpath,1)="/" then exit function
set dr=CreateObject("Adodb.Stream")
dr.Mode=3
dr.Type=1
dr.Open
upfile_5xSoft_Stream.position=FileStart-1
upfile_5xSoft_Stream.copyto dr,FileSize
dr.SaveToFile FullPath,2
dr.Close
set dr=nothing
SaveAs=0
end function
End Class

思路是这样,通过js创建一个新的表单(不可见的),将input放到表单中去,调用submit()控制上传。如果不想自己实现,也可以百度一个“ajaxfileupload.js”的东东。
另外一种方法是将图片内容序列化,通过ajax提交。

无惧无组件上传:
这是放到前面让选择图片的代码和上传按钮 <form action="Upfile_ProductPic.asp?Act=index" method="post" name="form2" onSubmit="return check()" enctype="multipart/form-data">
<input name="FileName" type="FILE" class="tx1" size="22">
<input type="submit" name="Submit1" value="上传" style="border:1px double rgb(88,88,88);font:9pt">
</form>

这是Upfile_ProductPic.asp文件,修改下存储路径和数据表
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><%@language=vbscript codepage=936 %>
<!--#include file="config.asp"-->
<!--#include file="upfile_class.asp"-->
<!--#include virtual="/config/config.asp"-->
<%
picname=Requesta("Act")
const upload_type=0 '上传方法:0=无惧无组件上传类,1=FSO上传 2=lyfupload,3=aspupload,4=chinaaspupload
'const SaveUpProductPicPath="UploadProductPic"
'const UpProductPicType="jpg|gif|png|bmp"
'const MaxProductPicSize=20480000

dim upload,oFile,formName,SavePath,FileName,fileExt,oFileSize
dim EnableUpload
dim arrUpFileType
dim ranNum
dim msg,FoundErr
msg=""
FoundErr=false
EnableUpload=false
SavePath = "upfiles/" '存放上传文件的目录
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>
<body leftmargin="2" topmargin="5" marginwidth="0" marginheight="0">
<%
if EnableUploadFile="No" then
response.write "系统未开放文件上传功能"
else

select case upload_type
case 0
call upload_0() '使用化境无组件上传类
case else
'response.write "本系统未开放插件功能"
'response.end
end select

end if
%>
</body>
</html>
<%
sub upload_0() '使用化境无组件上传类
set upload=new upfile_class ''建立上传对象
upload.GetData(20480000) '取得上传数据,限制最大上传500K
if upload.err > 0 then '如果出错
select case upload.err
case 1
response.write "请先选择你要上传的文件!"
case 2
response.write "你上传的文件总大小超出了最大限制(20M)"
end select
response.end
end if

for each formName in upload.file '列出所有上传了的文件
EnableUpload=False
set ofile=upload.file(formName) '生成一个文件对象
oFileSize=ofile.filesize
if oFileSize<10 then
msg="请先选择你要上传的文件!!"
FoundErr=True
elseif ofilesize>(MaxProductPicSize*1024) then
msg="文件大小超过了限制,最大只能上传" & CStr(MaxProductPicSize) & "K的文件!"
FoundErr=true
end if

fileExt=lcase(ofile.FileExt)
arrUpFileType=split(UpProductPicType,"|")
for i=0 to ubound(arrUpFileType)
if fileEXT=trim(arrUpFileType(i)) then
EnableUpload=true
exit for
end if
next
if fileEXT="asp" or fileEXT="asa" or fileEXT="aspx" or fileEXT="cer" or fileEXT="cdx" then
EnableUpload=false
end if
if EnableUpload=false then
msg="这种文件类型不允许上传!\n\n只允许上传这几种文件类型:" & UpProductPicType
FoundErr=true
end if

strJS="<SCRIPT language=javascript>" & vbcrlf
if FoundErr<>true then
randomize
ranNum=int(900*rnd)+100
FileName="../../"&SavePath&picname&"."&fileExt

ofile.SaveToFile Server.mappath(FileName) '保存文件
conn.open constr
sql="update indexPic set p_picture='"&picname&"."&fileExt&"' where p_name='"&picname&"'"
conn.execute(sql)
conn.close
Alert_reDirect "上传成功!","indexPic.asp"

end if
next
set upload=nothing
end sub
%>

这是upfile_class.asp文件,不用更改。
<%

Dim oUpFileStream
'----------------------------------------------------------------------
'文件上传类
Class UpFile_Class

Dim Form,File,Version,Err

Private Sub Class_Initialize
Version = "无惧上传类 Version V1.2"
Err = -1
End Sub

Private Sub Class_Terminate
'清除变量及对像
If Err < 0 Then
Form.RemoveAll
Set Form = Nothing
File.RemoveAll
Set File = Nothing
oUpFileStream.Close
Set oUpFileStream = Nothing
End If
End Sub

Public Sub GetData (MaxSize)
'定义变量
Dim RequestBinDate,sSpace,bCrLf,sInfo,iInfoStart,iInfoEnd,tStream,iStart,oFileInfo
Dim iFileSize,sFilePath,sFileType,sFormValue,sFileName
Dim iFindStart,iFindEnd
Dim iFormStart,iFormEnd,sFormName
'代码开始
If Request.TotalBytes < 1 Then '如果没有数据上传
Err = 1
Exit Sub
End If
If MaxSize > 0 Then '如果限制大小
If Request.TotalBytes > MaxSize Then
Err = 2 '如果上传的数据超出限制
Exit Sub
End If
End If
Set Form = Server.CreateObject ("Scripting.Dictionary")
Form.CompareMode = 1
Set File = Server.CreateObject ("Scripting.Dictionary")
File.CompareMode = 1
Set tStream = Server.CreateObject ("ADODB.Stream")
Set oUpFileStream = Server.CreateObject ("ADODB.Stream")
oUpFileStream.Type = 1
oUpFileStream.Mode = 3
oUpFileStream.Open
oUpFileStream.Write Request.BinaryRead (Request.TotalBytes)
oUpFileStream.Position = 0
RequestBinDate = oUpFileStream.Read
iFormEnd = oUpFileStream.Size
bCrLf = ChrB (13) & ChrB (10)
'取得每个项目之间的分隔符
sSpace = MidB (RequestBinDate,1, InStrB (1,RequestBinDate,bCrLf)-1)
iStart = LenB (sSpace)
iFormStart = iStart+2
'分解项目
Do
iInfoEnd = InStrB (iFormStart,RequestBinDate,bCrLf & bCrLf)+3
tStream.Type = 1
tStream.Mode = 3
tStream.Open
oUpFileStream.Position = iFormStart
oUpFileStream.CopyTo tStream,iInfoEnd-iFormStart
tStream.Position = 0
tStream.Type = 2
tStream.CharSet = "gb2312"
sInfo = tStream.ReadText
'取得表单项目名称
iFormStart = InStrB (iInfoEnd,RequestBinDate,sSpace)-1
iFindStart = InStr (22,sInfo,"name=""",1)+6
iFindEnd = InStr (iFindStart,sInfo,"""",1)
sFormName = Trim(Mid (sinfo,iFindStart,iFindEnd-iFindStart))
'如果是文件
If InStr (45,sInfo,"filename=""",1) > 0 Then
Set oFileInfo = new FileInfo_Class
'取得文件属性
iFindStart = InStr (iFindEnd,sInfo,"filename=""",1)+10
iFindEnd = InStr (iFindStart,sInfo,"""",1)
sFileName = Trim(Mid(sinfo,iFindStart,iFindEnd-iFindStart))
oFileInfo.FileName = Mid (sFileName,InStrRev (sFileName, "\")+1)
oFileInfo.FilePath = Left (sFileName,InStrRev (sFileName, "\"))
oFileInfo.FileExt = Mid (sFileName,InStrRev (sFileName, ".")+1)
iFindStart = InStr (iFindEnd,sInfo,"Content-Type: ",1)+14
iFindEnd = InStr (iFindStart,sInfo,vbCr)
oFileInfo.FileType = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
oFileInfo.FileStart = iInfoEnd
oFileInfo.FileSize = iFormStart -iInfoEnd -2
oFileInfo.FormName = sFormName
file.add sFormName,oFileInfo
else
'如果是表单项目
tStream.Close
tStream.Type = 1
tStream.Mode = 3
tStream.Open
oUpFileStream.Position = iInfoEnd
oUpFileStream.CopyTo tStream,iFormStart-iInfoEnd-2
tStream.Position = 0
tStream.Type = 2
tStream.CharSet = "gb2312"
sFormValue = tStream.ReadText
If Form.Exists (sFormName) Then
Form (sFormName) = Form (sFormName) & ", " & sFormValue
else
form.Add sFormName,sFormValue
End If
End If
tStream.Close
iFormStart = iFormStart+iStart+2
'如果到文件尾了就退出
Loop Until (iFormStart+2) >= iFormEnd
RequestBinDate = ""
Set tStream = Nothing
End Sub
End Class

'----------------------------------------------------------------------------------------------------
'文件属性类
Class FileInfo_Class
Dim FormName,FileName,FilePath,FileSize,FileType,FileStart,FileExt
'保存文件方法
Public Function SaveToFile (Path)
if lcase((right(Path,3))<>lcase(FileExt)) then '经典的上传漏洞^_^
response.Write ("<script language=javascript>alert('警告:不允许上传这种文件!');</script>")
response.end
end if
On Error Resume Next
Dim oFileStream
Set oFileStream = CreateObject ("ADODB.Stream")
oFileStream.Type = 1
oFileStream.Mode = 3
oFileStream.Open
oUpFileStream.Position = FileStart
oUpFileStream.CopyTo oFileStream,FileSize
oFileStream.SaveToFile Path,2
oFileStream.Close
Set oFileStream = Nothing
End Function

'取得文件数据
Public Function FileData
oUpFileStream.Position = FileStart
FileData = oUpFileStream.Read (FileSize)
End Function

End Class

'**************************************************
'函数名:IsObjInstalled
'作 用:检查组件是否已经安装
'参 数:strClassString ----组件名
'返回值:True ----已经安装
' False ----没有安装
'**************************************************
Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
Set xTestObj = Nothing
Err = 0
End Function
'-------------根据指定名称生成目录---------
Function MakeNewsDir(foldername)
dim fso,f
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder(foldername)
MakeNewsDir = True
Set fso = nothing
End Function

%>

还是用无组件上传吧,简单实用,示例也多。地球人都在用

upload.asp文件
<%
Function GetFileName(ByVal strFile)
If strFile <> "" Then
GetFileName = mid(strFile,InStrRev(strFile, "\")+1)
Else
GetFileName = ""
End If
End function

strFileName = Request.Form("file1")
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1 ' adTypeBinary
objStream.Open
objStream.LoadFromFile strFileName
objStream.SaveToFile Server.MapPath(GetFileName(strFileName)),2
objStream.Close
%>

一般上传图片常用的是无组件上传,加我HI帮你看看吧!


请问SP平台具体指向什么?SP的扣费是怎么进行的?需要怎么样的技术人员...
SP\/CP是指内容和服务提供商,就是给用户提供比如下载图片铃声,看新闻等内容和服务的平台,SP的扣费也是SP向通信商如移动、联通等公司相关报批的,也就是自己定的,报给移动运营商,他们同意就可以按这个标准向用户收费了,一家SP和一家SP的收费也是不相同的,大致分两种,按月和按次的,但都有最高...

Sp快捷键(sp快捷键转灯光)
sp快捷键换界面在办公电脑中安装好Photoshop软件,并点击运行。准备好需要去色的照片,并将照片拖拽到Photoshop编辑界面,或者按ctrl+o打开照片所在位置,将照片导入到软件中。选择“图像”菜单栏,选择该菜单栏下的“调整”下拉菜单,在该下拉菜单中选择“黑白”选项,也可以按快捷键“Alt+shift+ctrl+B”按钮,完成图像去...

Android怎么实现边采集边上传
最近看了Sipdroid和ZXing两个开源代码,对于如何在Andrpid平台上实现边采集边上传的功能有了新的见解,同时也决定重新弄一下以前做的广州亚运排传的项目.先给大家说下软件的功能吧.拿出android手机然后采集实时的图片数据,并对这些采集的图片数据进行H264编码,然后根据协议上传到公司的服务器上。那么现在大家...

SP是什么意思?
1 什么是SP?什么是SP?SP指移动互联网服务内容应用服务的直接提供者,负责根据用户的要求开发和提供适合手机用户使用的服务。从企业业务开展的角度来看,目前 SP可以分成三大类:★门户型 SP就是由门户网站提供的短信服务。主要有搜狐、新浪、网易、中华网、Tom等几家。其短信服务的内容主要有铃声、图片、...

贴吧头像动态图怎么上传?
然后选择左侧的“书签栏”,并在右侧右击鼠标,从弹出的菜单中选择“添加网页”项。接着输入名称为“上传动态图片”,网址设置为“javascript:var i=document.createElement('input');i.type='file';document.getElementsByClassName('setting-profile-title')[0].appendChild(i);”(不含引号)。利用同样...

求flash as3.0调用库图片的代码
库图片设置连接属性,在第一帧导出,类名随便设置个,使用的时候 var 变量:Bitmap=new 类名(即上面随便设的那个) as Bitmap;从你给的这点代码,看不到被传入粒子引擎的变量是什么。。。

说一下空间代码的使用,顺便介绍一下一些代码
#header div.lc ——主页左上角背景图片 #header div.rc—— 主页右上角背景图片 #header div.tit ——空间名称,即主标题,名字大小颜色#header div.tit a.titlink ——空间名称链接,未被点击 #header div.tit a.titlink:visited——已被访问过的链接#header div.desc ——空间简介,即副标题,位置大小颜色...

空间里打字回复时打字部分如何插入图片>?
用这个代码图片最佳大小为503×153以下代码是我曾经用过的样式,包括图片,如果你喜欢全部复制过去就行了!如果不喜欢就换自己喜欢的吧,包括字体颜色大小等!#spBlogCmtText {color:#A25E5E;font-size:25px;font-family:黑体;background:url() no-repeat top center;background-attachment:fixed;...

php如何获取图片上传的临时文件名
这个要看你上传后是否修改过上穿图片的存放位置 如果修改过就在你存放上传图片的位置中去找 一般上传图片都有自己的命名方式 一般都是以时间的 时间最大的那就是你刚刚上传的呀

PS和SP有区别吗,不懂
2. 指Photoshop,一种有名的专业图像处理软件.3. PS指索尼公司的游戏机play station,它的后续版本有PS2、PSP、PS3.http:\/\/baike.baidu.com\/view\/7556.htm SP SP是Service Provider(服务提供者)的缩写,是指电信增值服务提供商,即通过运营商提供的增值接口为用户提供服务,然后由运营商在用户的...

广陵区15135258128: asp,最简单的上传图片
锺胥复方: 1.如果服务器装了文件上传组件,可查阅一下该组件的相关属性和方法,不过现在很多服务器空间都不支持这类组件.暂不在这里讨论. 2.若服务器不支持文件上传组件,可以考虑自己写个无组件上传程序,网上有一个"化境无组件上传"比较经...

广陵区15135258128: 求asp无组件上传图片代码 100分悬赏 -
锺胥复方: ASP无组件上传图片源代码 <% '上传方法,0=无组件,1=chinaaspupload dim upload_type upload_type=uploaddim uploadsuc dim Forumupload dim ranNum dim uploadfiletype dim upload,file,formName,formPath,iCount,filename,fileExt response...

广陵区15135258128: 提供有关上传图片的ASP代码??哪位好心人有呀??
锺胥复方: 一、设计数据库 b 为方便调试,设计表imgurl,其中两个字段:id(自动编号、关键字)、img(OLE 对象) 二、连接数据库文件 p 三、提供上传图片的表单页面 ml 四、接受数据并添加记录页 p

广陵区15135258128: asp无组件上传图片 -
锺胥复方: <% strFileName = Request("file") '得到前一页提交来的文件地址值 Set objStream = Server.CreateObject("ADODB.Stream") objStream.Type = 1 ' adTypeBinary objStream.Open objStream.LoadFromFile strFileName objStream.SaveToFile Server.MapPath("abc.jpg"),2 '保存到当前ASP文件同目录下,名字为abc.jpg objStream.Close%> 够简单吧! 呵呵,不成功的话,给我留言,我帮你看看!偶也是新手,但偶用成功着呢!

广陵区15135258128: asp上传图片并显示的代码 -
锺胥复方: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language=javascript src="dialog.js"></script> <script language="javascript"> document.write ("<link href='../language/zh-cn.css' type='text/css' ...

广陵区15135258128: ASP图片上传代码//急急急//
锺胥复方: &lt;% set upload=new upload_5xsoft set file=upload.file("sf_upfile") if file.fileSize&lt;1 then response.write"&lt;script language=javascript&gt;alert('您没有选择图片.~~~\n\n-----请点击浏览按钮,从弹出的窗口中选择要上传的图片.\n\n-----然后...

广陵区15135258128: asp上传图片源码 -
锺胥复方: <% class clsUp '文件上传类 '------------------------ Dim Form,File Dim AllowExt_ '允许上传类型(白名单) Dim NoAllowExt_ '不允许上传类型(黑名单) Private oUpFileStream '上传的数据流 Private isErr_ '错误的代码,0或true表示无错 Private ...

广陵区15135258128: 求asp上传图片代码 -
锺胥复方: ====================图片入库==========================<!--#include virtual="/_inc/conn.inc"--><%'取得客户端送出的数据字节大小frmsize=Request.TotalBytes'以二进制方式读取数据frmData=Request.BinaryRead(frmsize)'去掉实...

广陵区15135258128: asp 上传图片怎么写啊 ! 请把代码告诉我 -
锺胥复方: upload.asp文件 <% Function GetFileName(ByVal strFile) If strFile <> "" Then GetFileName = mid(strFile,InStrRev(strFile, "")+1) Else GetFileName = "" End If End function strFileName = Request.Form("file1") Set objStream = Server....

广陵区15135258128: asp图片上传的代码请问怎么写
锺胥复方: 用组件不利于学习 目前有很多无组件上传类,我大概看了一下,大多写的相当复杂,有的居然还只能传文本最关键的是没有10行代码以下的 :)我花了一个晚上时间研究了一下ADODB.Stream,并且用了6行代码实现了无组件上传:...

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网