導航:首頁 > 版本升級 > asp無組件上傳多文件

asp無組件上傳多文件

發布時間:2025-08-18 01:16:36

❶ 如何在網頁實現上傳各種文件或圖片視頻等功能

回答如下:

1、無組件上傳系統,只要空間支持ASP,就可以使用,一般不會和空間沖突。

2、一般來說,你下載的源碼中都是含有使用方法的,我大致說一下吧:

比如你圖上的3個腳本,你可以在index.asp中放置一個表單,表單的提交(action="upload.asp")指向upload.asp腳本。在upload.asp腳本中,你需要調用upload_class.asp這個文件(這個文件定義的是一個上傳類和一些參數的介面),通過定義的參數和表單提交來的信息,獲取到文件的相關信息,比如大小、文件名等。

這2個文件里應該會有詳細的說明啊,我當時就是看了這個說明使用的。很好用哦

❷ 關於化境ASP無組件上傳類 - upload_5xsoft 使用的問題

菜名:<input type=text name="sname">
圖片:<input type=file name="sfile">

<%
set upload=upload_5xsoft
set file=upload.files("sfile")
filename=新文件名稱&Mid(file.filename,instr(file.filename,"."))
'如:新文件名.jpg
file.saveas server.mappath("..\upload\"&filename)
formname=upload.forms("sname")
set file=nothing
set upload=nothing

set conn=server...
set rs=server...
rs.open"select * from..."
rs.addnew
rs("菜名")=formname
rs("圖片")=filename
rs.update
rs.close
...

%>

❸ ASP怎樣無組件上傳文件到指定文件夾,並且將路徑寫入資料庫如題 謝謝了

<head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>示例結果</title> <link href="../style.css" rel="stylesheet" type="text/css"> </head> <body style="font-size:12px"> <% Dim Upload,successful '=============================================================================== set Upload=new AnUpload '創建類實例 Upload.SingleSize=1024*1024 '設置單個文件最大上傳限制,按位元組計;默認為不限制 Upload.MaxSize=4096*1024 '設置最大上傳限制,按位元組計;默認為不限制 Upload.Exe="rar|jpg|bmp|gif|doc|xls|ppt|txt" '設置合法擴展名,以|分割,忽略大小寫 Upload.GetData() '獲取並保存數據,必須調用本方法 '=============================================================================== if Upload.Err>0 then '判斷錯誤號,如果myupload.Err<=0表示正常 response.write Upload.Description '如果出現錯誤,獲取錯誤描述 else response.Write "表單text1的值為: " & Upload.Forms("text1") & "<br />" if Upload.forms("file1")<>"" then '這里判斷你file1是否選擇了文件 path=server.mappath("files") '文件保存路徑(這里是files文件夾) set tempCls=Upload.files("file1") successful=tempCls.SaveToFile(path,0) '以時間+隨機數字為文件名保存 'successful=tempCls.SaveToFile(path,1) '如果想以原文件名保存,請使用本句 if successful then response.write tempCls.FileName & "上傳完畢,大小為" & Upload.getsize(tempCls.Size) & ";<br />本地路徑" & Upload.forms("file1") & "!<br />" Response.Redirect "InsertDatabase.asp?FileName="&Upload.Forms("text1")&"&FilePath="&tempCls.FileName else response.write "上傳失敗" end if set tempCls=nothing end if end if set Upload=nothing '銷毀類實例 %> </body> </html>
採納哦

❹ 求asp無組件上傳圖片代碼 100分懸賞

ASP無組件上傳圖片源代碼
<%
'上傳方法,0=無組件,1=chinaaspupload
dim upload_type
upload_type=upload

dim uploadsuc
dim Forumupload
dim ranNum
dim uploadfiletype
dim upload,file,formName,formPath,iCount,filename,fileExt
response.write "<body leftmargin=0 topmargin=0>"
select case upload_type
case 0
call upload_0()
case 1
call upload_1()
case else
response.write "本系統未開放插件功能"
response.end
end select

sub upload_0()
set upload=new upload_5xSoft ''建立上傳對象

formPath=upload.form("filepath")
''在目錄後加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"

response.write "<body leftmargin=5 topmargin=3>"

for each formName in upload.file ''列出所有上傳了的文件
set file=upload.file(formName) ''生成一個文件對象
if file.filesize<100 then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">請先選擇你要上傳的圖片 [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if

if file.filesize>1024000 then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">圖片大小超過了限制 [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if

fileExt=lcase(getFileExtName(file.fileName))

if fileext<>"jpg" and fileext<>"png" and fileext<>"gif" and fileext<>"bmp" then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">該文件格式不允許上傳 [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if

randomize
rannum=int(90000*rnd)+10000
filename=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(formPath &filename) ''保存文件
response.write "<script>parent.document.FrmAddLink.photo.value='uploadfile/face/"&FileName&"'</script>"
end if
set file=nothing
next
set upload=nothing

Htmend iCount&" 個文件上傳結束!"
end sub

sub HtmEnd(Msg)
response.write "<span style=""font-family: 宋體; font-size: 9pt"">圖片上傳成功 [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"

response.end
end sub

sub upload_1()
set FileUp=server.createobject("ChinaASP.UpLoad") ''建立上傳對象

filepath=server.MapPath("../uploadfile/face/")

response.write "<body leftmargin=5 topmargin=3>"
for each f in fileup.Files ''列出所有上傳了的文件

if f.filesize<100 then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">請先選擇你要上傳的圖片 [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if

if f.filesize>1024000 then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">圖片大小超過了限制 [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
response.end
end if

fileExt=lcase(getFileExtName(f.fileName))

if fileext<>"jpg" and fileext<>"png" and fileext<>"gif" and fileext<>"bmp" then
response.write "<span style=""font-family: 宋體; font-size: 9pt"">該文件格式不允許上傳 [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"
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 f.FileSize>0 then ''如果 FileSize > 0 說明有文件數據
f.saveas filePath & "\"&filename ''保存文件
response.write "<script>parent.document.FrmAddLink.photo.value='uploadfile/face/"&FileName&"'</script>"
end if
set f=nothing
next
set FileUp=nothing

Htmend iCount&" 個文件上傳結束!"
end sub

sub HtmEnd(Msg)
response.write "<span style=""font-family: 宋體; font-size: 9pt"">圖片上傳成功 [ <a href=# onclick=history.go(-1)>重新上傳</a> ]</span>"

response.end
end sub
%>

❺ 化境ASP無組件類上傳大文件的問題

如果不能上傳大文件的話,那就是伺服器2003系統上的設置問態緩題了.

解決辦法:

1. 關閉 IIS Admin Service 服務 (運帆輪模行iisreset.exe /stop)

2. 打開桐消 Windows\system32\inesrv\metabase.xml

3. 修改 SPMaxRequestEntityAllowed 的值為自己需要的, 默認為 204800

4. 啟動 IIS Admin Service (運行iisreset.exe /start)

注意備份metabase.xml 文件

❻ asp代碼怎樣實現無組件上傳

一、無組件上傳的原理
我還是一點一點用一個實例來說明的吧,客戶端HTML如下。要瀏覽上傳附件,我們通過<input type="file">元素,但是一定要注意必須設置form的enctype屬性為"multipart/form-data":

<form method="post" action="upload.asp" enctype="multipart/form-data">
<label>
<input type="file" name="file1" />
</label>

<input type="text" name="filename" value="default filename"/>

<input type="submit" value="Submit"/>
<input type="reset" value="Reset"/>
</form>

在後台asp程序中,以前獲取表單提交的ASCII 數據,非常的容易。但是如果需要獲取上傳的文件,就必須使用Request對象的BinaryRead方法來讀取。BinaryRead方法是對當前輸入流進行指定位元組數的二進制讀取,有點需要注意的是,一旦使用BinaryRead 方法後,再也不能使用Request.Form 或 Request.QueryString 集合了。結合Request對象的TotalBytes屬性,可以將所有表單提交的數據全部變成二進制,不過這些數據都是經過編碼的。首先讓我們來看看這些數據是如何編碼的,有無什麼規律可循,編段代碼,在代碼中我們將BinaryRead讀取的二進制轉化為文本,輸出出來,在後台的upload.asp中(注意該示例不要上傳大文件,否則可能會造成瀏覽器死掉):
<%
Dim biData, PostData
Size = Request.TotalBytes
biData = Request.BinaryRead(Size)
PostData = BinaryToString(biData,Size)
Response.Write "<pre>" & PostData & "</pre>" '使用pre,原樣輸出格式
' 藉助RecordSet將二進制流轉化成文本
Function BinaryToString(biData,Size)
Const adLongVarChar = 201
Set RS = CreateObject("ADODB.Recordset")
RS.Fields.Append "mBinary", adLongVarChar, Size
RS.Open
RS.AddNew
RS("mBinary").AppendChunk(biData)
RS.Update
BinaryToString = RS("mBinary").Value
RS.Close
End Function
%>

❼ 如何在asp中使用無組件上傳文件!

2個文件
第一個文件:
<html>
<body>
<center>
<form name="mainForm" enctype="multipart/form-data" action="process.asp" method=post>
<input type=file name=mefile><br>
<input type=submit name=okvalue="OK">
</form>
</center>
</body>
</html>

第二個:
<%
sub pic()
if Request.QueryString("submit")="pic" then
uploadpath="image/face/"
uploadsize="2048"
uploadtype="jpg/gif/png/bmp"
Set Uprequest=new UpLoadClass
Uprequest.SavePath=uploadpath
Uprequest.MaxSize=uploadsize*1024
Uprequest.FileType=uploadtype
AutoSave=true
Uprequest.open
if Uprequest.form("file_Err")<>0 then
select case Uprequest.form("file_Err")
case 1:str="<div style=""padding-top:5px;padding-bottom:5px;""> <font color=blue>上傳不成功!文件超過"&uploadsize&"k [<a href='javascript:history.go(-1)'>重新上傳</a>]</font></div>"
case 2:str="<div style=""padding-top:5px;padding-bottom:5px;""> <font color=blue>上傳不成功!文件格式不對 [<a href='javascript:history.go(-1)']>重新上傳</a>]</font></div>"
case 3:str="<div style=""padding-top:5px;padding-bottom:5px;""> <font color=blue>上傳不成功!文件太大且格式不對 [<a href='javascript:history.go(-1)'>重新上傳</a>]</font></div>"
end select
response.write str
else
response.write "<script language=""javascript"">parent.form2.pic.value='"&Uprequest.SavePath&Uprequest.Form("file")&"';"
response.write "</script>"
response.write "</script>"
size=Uprequest.Form("file_size")
showsize=size & " Byte"
if size>1024 then
size=(size\1024)
showsize=size & " KB"
end if
if size>1024 then
size=(size/1024)
showsize=formatnumber(size,2) & " MB"
end if
response.write "<script language=""javascript"">parent.form2.url.value='"&showsize&"';"
response.write "</script>"
response.write "<div style=""padding-top:5px;padding-bottom:5px;""> <font color=red>文件上傳成功</font> [<a href='javascript:history.go(-1)'>重新上傳</a>]</div>"
end if
Set Uprequest=nothing
end if
response.write "<form name=form action=?action=pic&submit=pic method=post enctype=multipart/form-data>"
response.write "<input type=file name=file class='tx' size='20'> "
response.write "<input type=submit name=submit value=上傳 class=""tx1"">"
response.write "</form>"
end sub
%>

閱讀全文

與asp無組件上傳多文件相關的資料

熱點內容
vf查詢文件默認去哪裡 瀏覽:146
哪些網站可以看到頭條熱度 瀏覽:210
網銀支付介面代碼 瀏覽:883
大數據技術專業和軟體技術哪個難 瀏覽:244
領導加入微信群歡迎語 瀏覽:905
asp無組件上傳多文件 瀏覽:709
為什麼我的高德地圖沒有網路了 瀏覽:657
心臟監護儀黃色的是什麼數據 瀏覽:713
怎麼把桌面的文件隱藏的文件夾圖標 瀏覽:280
造價要依據哪些文件 瀏覽:499
除了按鍵找圖還有什麼編程軟體 瀏覽:352
什麼是網路作文 瀏覽:454
7個字的文件夾 瀏覽:614
表格中兩列數據條如何合並 瀏覽:872
javatcp封裝 瀏覽:497
word文檔紅頭文件標題怎麼製作 瀏覽:553
app20什麼意思 瀏覽:998
如何判斷數據是否正態分布 瀏覽:551
電腦微信聊天記錄搜索不到文件 瀏覽:190
word標題設計 瀏覽:495

友情鏈接