當前位置:首頁 » 文件管理 » 風聲無組件上傳

風聲無組件上傳

發布時間: 2022-11-19 01:37:32

『壹』 急求助!!!關於風聲無組件上傳報錯

應該是缺少DLL,到網上搜索下「scrrun.dll」,下載後放後windows系統目錄再試下。

『貳』 ASP風聲無組件上傳文件

這個簡單
<%
Set myRequest=new UpLoadClass
myRequest.FileType ="gif/jpg"'"gif/jpg"
myRequest.Savepath = "pic/"
myrequest.open

sql = "select * from tab"
set rs = server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addNew
rs("title") = myRequest.Form("title")
rs("file1") = myRequest.Form("file1")
rs("file2") = myRequest.Form("file2")
rs.update
set rs = nothing
%>
1.文件自動上傳到pic目錄自按日期時間生成不重復的文件名
2.上傳的文件的文件名自動生成並可這樣取出
myRequest.Form("file1")
3.text框的數據這樣取
myRequest.Form("title")
4.這個類的代碼可在這里
<%
'*****************************圖片上傳類開始*******************
Class UpLoadClass

Private p_MaxSize,p_FileType,p_SavePath,p_AutoSave,p_Error
Private objForm,binForm,binItem,strDate,lngTime
Public FormItem,FileItem

Public Property Get Version
Version="Rumor UpLoadClass Version 2.0"
End Property

Public Property Get Error
Error=p_Error
End Property

Public Property Get MaxSize
MaxSize=p_MaxSize
End Property
Public Property Let MaxSize(lngSize)
if isNumeric(lngSize) then
p_MaxSize=clng(lngSize)
end if
End Property

Public Property Get FileType
FileType=p_FileType
End Property
Public Property Let FileType(strType)
p_FileType=strType
End Property

Public Property Get SavePath
SavePath=p_SavePath
End Property
Public Property Let SavePath(strPath)
p_SavePath=replace(strPath,chr(0),"")
End Property

Public Property Get AutoSave
AutoSave=p_AutoSave
End Property
Public Property Let AutoSave(byVal Flag)
select case Flag
case 0:
case 1:
case 2:
case false:Flag=2
case else:Flag=0
end select
p_AutoSave=Flag
End Property

Private Sub Class_Initialize
p_Error = -1
p_MaxSize = 204800000000'0//設定上傳圖片大小
p_FileType = "jpg/gif"
p_SavePath = ""
p_AutoSave = 0
strDate = replace(cstr(Date()),"-","")
strDate = replace(cstr(Date()),"/","")
lngTime = clng(timer()*1000)
Set binForm = Server.CreateObject("ADODB.Stream")
Set binItem = Server.CreateObject("ADODB.Stream")
Set objForm = Server.CreateObject("Scripting.Dictionary")
objForm.CompareMode = 1
End Sub

Private Sub Class_Terminate
objForm.RemoveAll
Set objForm = nothing
Set binItem = nothing
'binForm.Close()
Set binForm = nothing
End Sub

Public Sub Open()
if p_Error=-1 then
p_Error=0
else
Exit Sub
end if
Dim lngRequestSize,binRequestData,strFormItem,strFileItem
Const strSplit="'"">"
lngRequestSize=Request.TotalBytes
if lngRequestSize<1 then
p_Error=4
Exit Sub
end if
binRequestData=Request.BinaryRead(lngRequestSize)
binForm.Type = 1
binForm.Open
binForm.Write binRequestData

Dim bCrLf,strSeparator,intSeparator
bCrLf=ChrB(13)&ChrB(10)

intSeparator=InstrB(1,binRequestData,bCrLf)-1
strSeparator=LeftB(binRequestData,intSeparator)

Dim p_start,p_end,strItem,strInam,intTemp,strTemp
Dim strFtyp,strFnam,strFext,lngFsiz
p_start=intSeparator+2
Do
p_end =InStrB(p_start,binRequestData,bCrLf&bCrLf)+3
binItem.Type=1
binItem.Open
binForm.Position=p_start
binForm.CopyTo binItem,p_end-p_start
binItem.Position=0
binItem.Type=2
binItem.Charset="gb2312"
strItem=binItem.ReadText
binItem.Close()

p_start=p_end
p_end =InStrB(p_start,binRequestData,strSeparator)-1
binItem.Type=1
binItem.Open
binForm.Position=p_start
lngFsiz=p_end-p_start-2
binForm.CopyTo binItem,lngFsiz

intTemp=Instr(39,strItem,"""")
strInam=Mid(strItem,39,intTemp-39)

if Instr(intTemp,strItem,"filename=""")<>0 then
if not objForm.Exists(strInam&"_From") then
strFileItem=strFileItem&strSplit&strInam
if binItem.Size<>0 then
intTemp=intTemp+13
strFtyp=Mid(strItem,Instr(intTemp,strItem,"Content-Type: ")+14)
strTemp=Mid(strItem,intTemp,Instr(intTemp,strItem,"""")-intTemp)
intTemp=InstrRev(strTemp,"\")
strFnam=Mid(strTemp,intTemp+1)
objForm.Add strInam&"_Type",strFtyp
objForm.Add strInam&"_Name",strFnam
objForm.Add strInam&"_Path",Left(strTemp,intTemp)
objForm.Add strInam&"_Size",lngFsiz
if Instr(intTemp,strTemp,".")<>0 then
strFext=Mid(strTemp,InstrRev(strTemp,".")+1)
else
strFext=""
end if
if left(strFtyp,6)="image/" then
binItem.Position=0
binItem.Type=1
strTemp=binItem.read(10)
if strcomp(strTemp,chrb(255) & chrb(216) & chrb(255) & chrb(224) & chrb(0) & chrb(16) & chrb(74) & chrb(70) & chrb(73) & chrb(70),0)=0 then
if Lcase(strFext)<>"jpg" then strFext="jpg"
binItem.Position=3
do while not binItem.EOS
do
intTemp = ascb(binItem.Read(1))
loop while intTemp = 255 and not binItem.EOS
if intTemp < 192 or intTemp > 195 then
binItem.read(Bin2Val(binItem.Read(2))-2)
else
Exit do
end if
do
intTemp = ascb(binItem.Read(1))
loop while intTemp < 255 and not binItem.EOS
loop
binItem.Read(3)
objForm.Add strInam&"_Height",Bin2Val(binItem.Read(2))
objForm.Add strInam&"_Width",Bin2Val(binItem.Read(2))
elseif strcomp(leftB(strTemp,8),chrb(137) & chrb(80) & chrb(78) & chrb(71) & chrb(13) & chrb(10) & chrb(26) & chrb(10),0)=0 then
if Lcase(strFext)<>"png" then strFext="png"
binItem.Position=18
objForm.Add strInam&"_Width",Bin2Val(binItem.Read(2))
binItem.Read(2)
objForm.Add strInam&"_Height",Bin2Val(binItem.Read(2))
elseif strcomp(leftB(strTemp,6),chrb(71) & chrb(73) & chrb(70) & chrb(56) & chrb(57) & chrb(97),0)=0 or strcomp(leftB(strTemp,6),chrb(71) & chrb(73) & chrb(70) & chrb(56) & chrb(55) & chrb(97),0)=0 then
if Lcase(strFext)<>"gif" then strFext="gif"
binItem.Position=6
objForm.Add strInam&"_Width",BinVal2(binItem.Read(2))
objForm.Add strInam&"_Height",BinVal2(binItem.Read(2))
elseif strcomp(leftB(strTemp,2),chrb(66) & chrb(77),0)=0 then
if Lcase(strFext)<>"bmp" then strFext="bmp"
binItem.Position=18
objForm.Add strInam&"_Width",BinVal2(binItem.Read(4))
objForm.Add strInam&"_Height",BinVal2(binItem.Read(4))
end if
end if
objForm.Add strInam&"_Ext",strFext
objForm.Add strInam&"_From",p_start
intTemp=GetFerr(lngFsiz,strFext)
if p_AutoSave<>2 then
objForm.Add strInam&"_Err",intTemp
if intTemp=0 then
if p_AutoSave=0 then
strFnam=GetTimeStr()
if strFext<>"" then strFnam=strFnam&"."&strFext
end if
binItem.SaveToFile Server.MapPath(p_SavePath&strFnam),2
objForm.Add strInam,strFnam
end if
end if
else
objForm.Add strInam&"_Err",-1
end if
end if
else
binItem.Position=0
binItem.Type=2
binItem.Charset="gb2312"
strTemp=binItem.ReadText
if objForm.Exists(strInam) then
objForm(strInam) = objForm(strInam)&","&strTemp
else
strFormItem=strFormItem&strSplit&strInam
objForm.Add strInam,strTemp
end if
end if

binItem.Close()
p_start = p_end+intSeparator+2
loop Until p_start+3>lngRequestSize
FormItem=split(strFormItem,strSplit)
FileItem=split(strFileItem,strSplit)
End Sub

Private Function GetTimeStr()
lngTime=lngTime+1
GetTimeStr=strDate&lngTime
End Function

Private Function GetFerr(lngFsiz,strFext)
dim intFerr
intFerr=0
if lngFsiz>p_MaxSize and p_MaxSize>0 then
if p_Error=0 or p_Error=2 then p_Error=p_Error+1
intFerr=intFerr+1
end if
if Instr(1,LCase("/"&p_FileType&"/"),LCase("/"&strFext&"/"))=0 and p_FileType<>"" then
if p_Error<2 then p_Error=p_Error+2
intFerr=intFerr+2
end if
GetFerr=intFerr
End Function

Public Function Save(Item,strFnam)
Save=false
if objForm.Exists(Item&"_From") then
dim intFerr,strFext
strFext=objForm(Item&"_Ext")
intFerr=GetFerr(objForm(Item&"_Size"),strFext)
if objForm.Exists(Item&"_Err") then
if intFerr=0 then
objForm(Item&"_Err")=0
end if
else
objForm.Add Item&"_Err",intFerr
end if
if intFerr<>0 then Exit Function
if VarType(strFnam)=2 then
select case strFnam
case 0:strFnam=GetTimeStr()
if strFext<>"" then strFnam=strFnam&"."&strFext
case 1:strFnam=objForm(Item&"_Name")
end select
end if
binItem.Type = 1
binItem.Open
binForm.Position = objForm(Item&"_From")
binForm.CopyTo binItem,objForm(Item&"_Size")
binItem.SaveToFile Server.MapPath(p_SavePath&strFnam),2
binItem.Close()
if objForm.Exists(Item) then
objForm(Item)=strFnam
else
objForm.Add Item,strFnam
end if
Save=true
end if
End Function

Public Function GetData(Item)
GetData=""
if objForm.Exists(Item&"_From") then
if GetFerr(objForm(Item&"_Size"),objForm(Item&"_Ext"))<>0 then Exit Function
binForm.Position = objForm(Item&"_From")
GetData=binFormStream.Read(objForm(Item&"_Size"))
end if
End Function

Public Function Form(Item)
if objForm.Exists(Item) then
Form=objForm(Item)
else
Form=""
end if
End Function

Private Function BinVal2(bin)
dim lngValue,i
lngValue = 0
for i = lenb(bin) to 1 step -1
lngValue = lngValue *256 + ascb(midb(bin,i,1))
next
BinVal2=lngValue
End Function

Private Function Bin2Val(bin)
dim lngValue,i
lngValue = 0
for i = 1 to lenb(bin)
lngValue = lngValue *256 + ascb(midb(bin,i,1))
next
Bin2Val=lngValue
End Function

End Class

%>

『叄』 求大蝦幫個忙:風聲 ASP 無組件上傳類 V2.11更改上傳文件名的問題

這個很簡單的,你自己找到
Public
Function
Save(Item,strFnam)
模塊
在:
case
1:strFnam=m_dicForm(Item&"_Name")
後面增加一個:
case
2:strFnam=GetTimeStr()&m_dicForm(Item&"_Name")
'這里你還可以改成其他你所需的任何格式
然後在調用時這樣:
request2.AutoSave=2
'設置為手動保存模式
request2.Open()
request2.Save("strPhoto1",2)
'這里的
strPhoto1是要改成你自己表單中的FILE對應的ID

『肆』 風聲ASP無組件上傳類 V2.11的問題

1、使用 Persists.upload
2、使用第三方編輯器中的上傳功能 ,例如網路的Ueditor、KindEditor等,省去瀏覽器兼容問題,同時界面美觀,上傳方便

『伍』 使用「化境ASP無組件上傳類」或是「風聲無組件上傳類」如何壓縮圖片

aspjpeg對,樓上說了,用aspjpeg。
Set Jpegppp = Server.CreateObject("Persits.Jpeg")
Jpegppp.Open FileName
Jpegppp.PreserveAspectRatio=true'等比縮放
Jpegppp.Interpolation=2
Jpegppp.Quality=100
Jpegppp.Width = 寬度
Jpegppp.crop 0,CInt((Jpegppp.Height-高度)/2),寬度,CInt((Jpegppp.Height-高度)/2)+高度
jpegppp.Sharpen 1, 120
Jpegppp.Save server.MapPath(strDir&""&file_numa&"2"&file_numab&fileEXT)
Jpegppp.close
set Jpegppp=nothing

『陸』 誰知道風聲無組件上傳目錄在哪裡修改

if request2.save("file1",0) then ' 文件存儲成功 end if 處理的時候這里.你改那個數字參數就行了. 這個是完整的例子. <!--#include file="UpLoadClass.asp" --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>圖片管理</title> </head> <body> <% dim request2 set request2=New UpLoadClass request2.AutoSave=2 request2.open() if request2.save("file1",0) then 'file1 是文件file控制項的名字,0代表存儲參數,我設的0表示按時間命名,你可以改成其他的。 '存儲成功 else '存儲失敗 end if %> </body> </html>

『柒』 asp用風聲無組件上傳,上傳後如何返迴路徑到原頁面的input中

<script language="javascript">
opener.document.getElementById("inputID").value='圖片路徑';
alert("\n\n上傳成功!\n\n請點擊保存或修改按鈕以保存更改!")
window.close();
</script>

註:b.html頁面一定要用window.open方式打開,否則在執行window.close();時會彈出關閉窗口的確認框。

『捌』 ASP無組件批量上傳圖片

使用風聲無組件上傳類
<%
Set myRequest=new UpLoadClass
myRequest.FileType ="gif/jpg"'"gif/jpg"
myRequest.Savepath = "pic/"
myrequest.open

sql = "select * from tab"
set rs = server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addNew
rs("title") = myRequest.Form("title")
rs("file1") = myRequest.Form("file1")
rs("file2") = myRequest.Form("file2")
rs.update
set rs = nothing
%>
1.文件自動上傳到pic目錄自按日期時間生成不重復的文件名
2.上傳的文件的文件名自動生成並可這樣取出
myRequest.Form("file1")
3.text框的數據這樣取
myRequest.Form("title")
4.這個類的代碼可在這里
<%
'*****************************圖片上傳類開始*******************
Class UpLoadClass

Private p_MaxSize,p_FileType,p_SavePath,p_AutoSave,p_Error
Private objForm,binForm,binItem,strDate,lngTime
Public FormItem,FileItem

Public Property Get Version
Version="Rumor UpLoadClass Version 2.0"
End Property

Public Property Get Error
Error=p_Error
End Property

Public Property Get MaxSize
MaxSize=p_MaxSize
End Property
Public Property Let MaxSize(lngSize)
if isNumeric(lngSize) then
p_MaxSize=clng(lngSize)
end if
End Property

Public Property Get FileType
FileType=p_FileType
End Property
Public Property Let FileType(strType)
p_FileType=strType
End Property

Public Property Get SavePath
SavePath=p_SavePath
End Property
Public Property Let SavePath(strPath)
p_SavePath=replace(strPath,chr(0),"")
End Property

Public Property Get AutoSave
AutoSave=p_AutoSave
End Property
Public Property Let AutoSave(byVal Flag)
select case Flag
case 0:
case 1:
case 2:
case false:Flag=2
case else:Flag=0
end select
p_AutoSave=Flag
End Property

Private Sub Class_Initialize
p_Error = -1
p_MaxSize = 204800000000'0//設定上傳圖片大小
p_FileType = "jpg/gif"
p_SavePath = ""
p_AutoSave = 0
strDate = replace(cstr(Date()),"-","")
strDate = replace(cstr(Date()),"/","")
lngTime = clng(timer()*1000)
Set binForm = Server.CreateObject("ADODB.Stream")
Set binItem = Server.CreateObject("ADODB.Stream")
Set objForm = Server.CreateObject("Scripting.Dictionary")
objForm.CompareMode = 1
End Sub

Private Sub Class_Terminate
objForm.RemoveAll
Set objForm = nothing
Set binItem = nothing
'binForm.Close()
Set binForm = nothing
End Sub

Public Sub Open()
if p_Error=-1 then
p_Error=0
else
Exit Sub
end if
Dim lngRequestSize,binRequestData,strFormItem,strFileItem
Const strSplit="'"">"
lngRequestSize=Request.TotalBytes
if lngRequestSize<1 then
p_Error=4
Exit Sub
end if
binRequestData=Request.BinaryRead(lngRequestSize)
binForm.Type = 1
binForm.Open
binForm.Write binRequestData

Dim bCrLf,strSeparator,intSeparator
bCrLf=ChrB(13)&ChrB(10)

intSeparator=InstrB(1,binRequestData,bCrLf)-1
strSeparator=LeftB(binRequestData,intSeparator)

Dim p_start,p_end,strItem,strInam,intTemp,strTemp
Dim strFtyp,strFnam,strFext,lngFsiz
p_start=intSeparator+2
Do
p_end =InStrB(p_start,binRequestData,bCrLf&bCrLf)+3
binItem.Type=1
binItem.Open
binForm.Position=p_start
binForm.CopyTo binItem,p_end-p_start
binItem.Position=0
binItem.Type=2
binItem.Charset="gb2312"
strItem=binItem.ReadText
binItem.Close()

p_start=p_end
p_end =InStrB(p_start,binRequestData,strSeparator)-1
binItem.Type=1
binItem.Open
binForm.Position=p_start
lngFsiz=p_end-p_start-2
binForm.CopyTo binItem,lngFsiz

intTemp=Instr(39,strItem,"""")
strInam=Mid(strItem,39,intTemp-39)

if Instr(intTemp,strItem,"filename=""")<>0 then
if not objForm.Exists(strInam&"_From") then
strFileItem=strFileItem&strSplit&strInam
if binItem.Size<>0 then
intTemp=intTemp+13
strFtyp=Mid(strItem,Instr(intTemp,strItem,"Content-Type: ")+14)
strTemp=Mid(strItem,intTemp,Instr(intTemp,strItem,"""")-intTemp)
intTemp=InstrRev(strTemp,"\")
strFnam=Mid(strTemp,intTemp+1)
objForm.Add strInam&"_Type",strFtyp
objForm.Add strInam&"_Name",strFnam
objForm.Add strInam&"_Path",Left(strTemp,intTemp)
objForm.Add strInam&"_Size",lngFsiz
if Instr(intTemp,strTemp,".")<>0 then
strFext=Mid(strTemp,InstrRev(strTemp,".")+1)
else
strFext=""
end if
if left(strFtyp,6)="image/" then
binItem.Position=0
binItem.Type=1
strTemp=binItem.read(10)
if strcomp(strTemp,chrb(255) & chrb(216) & chrb(255) & chrb(224) & chrb(0) & chrb(16) & chrb(74) & chrb(70) & chrb(73) & chrb(70),0)=0 then
if Lcase(strFext)<>"jpg" then strFext="jpg"
binItem.Position=3
do while not binItem.EOS
do
intTemp = ascb(binItem.Read(1))
loop while intTemp = 255 and not binItem.EOS
if intTemp < 192 or intTemp > 195 then
binItem.read(Bin2Val(binItem.Read(2))-2)
else
Exit do
end if
do
intTemp = ascb(binItem.Read(1))
loop while intTemp < 255 and not binItem.EOS
loop
binItem.Read(3)
objForm.Add strInam&"_Height",Bin2Val(binItem.Read(2))
objForm.Add strInam&"_Width",Bin2Val(binItem.Read(2))
elseif strcomp(leftB(strTemp,8),chrb(137) & chrb(80) & chrb(78) & chrb(71) & chrb(13) & chrb(10) & chrb(26) & chrb(10),0)=0 then
if Lcase(strFext)<>"png" then strFext="png"
binItem.Position=18
objForm.Add strInam&"_Width",Bin2Val(binItem.Read(2))
binItem.Read(2)
objForm.Add strInam&"_Height",Bin2Val(binItem.Read(2))
elseif strcomp(leftB(strTemp,6),chrb(71) & chrb(73) & chrb(70) & chrb(56) & chrb(57) & chrb(97),0)=0 or strcomp(leftB(strTemp,6),chrb(71) & chrb(73) & chrb(70) & chrb(56) & chrb(55) & chrb(97),0)=0 then
if Lcase(strFext)<>"gif" then strFext="gif"
binItem.Position=6
objForm.Add strInam&"_Width",BinVal2(binItem.Read(2))
objForm.Add strInam&"_Height",BinVal2(binItem.Read(2))
elseif strcomp(leftB(strTemp,2),chrb(66) & chrb(77),0)=0 then
if Lcase(strFext)<>"bmp" then strFext="bmp"
binItem.Position=18
objForm.Add strInam&"_Width",BinVal2(binItem.Read(4))
objForm.Add strInam&"_Height",BinVal2(binItem.Read(4))
end if
end if
objForm.Add strInam&"_Ext",strFext
objForm.Add strInam&"_From",p_start
intTemp=GetFerr(lngFsiz,strFext)
if p_AutoSave<>2 then
objForm.Add strInam&"_Err",intTemp
if intTemp=0 then
if p_AutoSave=0 then
strFnam=GetTimeStr()
if strFext<>"" then strFnam=strFnam&"."&strFext
end if
binItem.SaveToFile Server.MapPath(p_SavePath&strFnam),2
objForm.Add strInam,strFnam
end if
end if
else
objForm.Add strInam&"_Err",-1
end if
end if
else
binItem.Position=0
binItem.Type=2
binItem.Charset="gb2312"
strTemp=binItem.ReadText
if objForm.Exists(strInam) then
objForm(strInam) = objForm(strInam)&","&strTemp
else
strFormItem=strFormItem&strSplit&strInam
objForm.Add strInam,strTemp
end if
end if

binItem.Close()
p_start = p_end+intSeparator+2
loop Until p_start+3>lngRequestSize
FormItem=split(strFormItem,strSplit)
FileItem=split(strFileItem,strSplit)
End Sub

Private Function GetTimeStr()
lngTime=lngTime+1
GetTimeStr=strDate&lngTime
End Function

Private Function GetFerr(lngFsiz,strFext)
dim intFerr
intFerr=0
if lngFsiz>p_MaxSize and p_MaxSize>0 then
if p_Error=0 or p_Error=2 then p_Error=p_Error+1
intFerr=intFerr+1
end if
if Instr(1,LCase("/"&p_FileType&"/"),LCase("/"&strFext&"/"))=0 and p_FileType<>"" then
if p_Error<2 then p_Error=p_Error+2
intFerr=intFerr+2
end if
GetFerr=intFerr
End Function

Public Function Save(Item,strFnam)
Save=false
if objForm.Exists(Item&"_From") then
dim intFerr,strFext
strFext=objForm(Item&"_Ext")
intFerr=GetFerr(objForm(Item&"_Size"),strFext)
if objForm.Exists(Item&"_Err") then
if intFerr=0 then
objForm(Item&"_Err")=0
end if
else
objForm.Add Item&"_Err",intFerr
end if
if intFerr<>0 then Exit Function
if VarType(strFnam)=2 then
select case strFnam
case 0:strFnam=GetTimeStr()
if strFext<>"" then strFnam=strFnam&"."&strFext
case 1:strFnam=objForm(Item&"_Name")
end select
end if
binItem.Type = 1
binItem.Open
binForm.Position = objForm(Item&"_From")
binForm.CopyTo binItem,objForm(Item&"_Size")
binItem.SaveToFile Server.MapPath(p_SavePath&strFnam),2
binItem.Close()
if objForm.Exists(Item) then
objForm(Item)=strFnam
else
objForm.Add Item,strFnam
end if
Save=true
end if
End Function

Public Function GetData(Item)
GetData=""
if objForm.Exists(Item&"_From") then
if GetFerr(objForm(Item&"_Size"),objForm(Item&"_Ext"))<>0 then Exit Function
binForm.Position = objForm(Item&"_From")
GetData=binFormStream.Read(objForm(Item&"_Size"))
end if
End Function

Public Function Form(Item)
if objForm.Exists(Item) then
Form=objForm(Item)
else
Form=""
end if
End Function

Private Function BinVal2(bin)
dim lngValue,i
lngValue = 0
for i = lenb(bin) to 1 step -1
lngValue = lngValue *256 + ascb(midb(bin,i,1))
next
BinVal2=lngValue
End Function

Private Function Bin2Val(bin)
dim lngValue,i
lngValue = 0
for i = 1 to lenb(bin)
lngValue = lngValue *256 + ascb(midb(bin,i,1))
next
Bin2Val=lngValue
End Function

End Class

%>

『玖』 風聲 ASP 無組件上傳類 V2.0更改上傳文件名的問題

Savepath文件存放的目錄 未指定
如myrequest.Savepath = "/images/up/" 類似這樣

『拾』 風聲ASP無組件上傳類上傳圖片的問題

我這里剛好有個解決方法。,精簡一下就是你想要的!

實現兩個數據分別傳到兩個文件

<%@ Language=VBScript %>
<html>
<head>
<meta name="VI60_defaultClientScript" content= "VBScript">
<title></title>
<style>
body {font: 12px/15px "宋體"; color:#444444; margin:0px; padding:0px; background-color:#eeeeee;}
</style>
</head>
<body>
<script id="clientEventHandlersVBS" LANGUAGE="vbscript">
<!--
Sub form1_onsubmit
form2.submit
End Sub
-->
</script>
<table>
<tr>
<td>
<form name="form2" action="ftxt.asp" method="post" style="margin:0px;padding:0px;">
<input type="txt" size="20" name="HH_ftxt" />
</form>
</td>
<td>
<form name="form1" action="HH_upload.asp" method="post" enctype="multipart/form-data" style="margin:0px;padding:0px">
<input type="file" size="15" name="file1" />
<input type= "submit" value="提交" />
</form>
</td>
</tr>
</table>
<body>
</html>

接受文字的文件和圖片UPLOAD文件分開

<%
HH_ftxt=request.form("HH_ftxt")
Session("H_ftxt")=HH_ftxt
%>

這個是接受文字的

<!--#include file="UpLoad_Class.vbs.asp"-->
<style>
body {font: 12px/15px "宋體"; color:#444444; margin:0px; padding:0px; background-color:#eeeeee;}
</style>
</head>
<body>
<%
set Ftxt=Nothing
Ftxt=Session("H_ftxt")
dim upload
set upload = new AnUpLoad
upload.Exe = "jpg|bmp|jpeg|gif|png|avi"
upload.MaxSize = 2 * 1024 * 1024 * 1024 '2000M
upload.GetData()
if upload.ErrorID>0 then
response.Write upload.Description
else
dim HH_txt
set HH_txt = upload.files("ftxt")
dim file,savpath
savepath = "upload"
set file = upload.files("file1")
if not(file is nothing) then
if file.saveToFile(savepath,0,true) then
%>
<script language="javascript">
parent.document.form1.xianshi.value=parent.document.form1.xianshi.value+"<%=file.filename%>||<%=Ftxt%>\n";
parent.document.form1.HH_uphide.value=parent.document.form1.HH_uphide.value+"||<%=file.filename%>,<%=Ftxt%>";
</script>
上傳成功,文件大小<%=file.size%>位元組.<a href="HH_input.asp">[繼續上傳]</a>
<%
else
response.Write file.Exception
end if
end if
end if
set upload = nothing
set Session("H_ftxt")=nothing
%>
</body>
</html>

這個是接受文件的

還有種方法就是,先傳文件再發說明。

熱點內容
宋春麗訪問 發布:2024-10-06 01:34:23 瀏覽:676
美國往事ftp 發布:2024-10-06 01:29:03 瀏覽:771
dtu編程 發布:2024-10-06 01:23:30 瀏覽:594
照片視頻加密 發布:2024-10-05 23:58:58 瀏覽:479
北京java培訓班多少錢 發布:2024-10-05 23:49:03 瀏覽:814
subversion源碼安裝 發布:2024-10-05 23:48:17 瀏覽:122
ipad文件怎麼解壓縮 發布:2024-10-05 23:06:28 瀏覽:166
存儲伺服器主控晶元 發布:2024-10-05 23:04:33 瀏覽:572
php學徒 發布:2024-10-05 23:04:30 瀏覽:441
活字格手機端清除緩存了什麼辦 發布:2024-10-05 23:03:23 瀏覽:874