Il peut être placé sur le serveur pour parcourir, télécharger et télécharger des fichiers sur le serveur et télécharger le code source de fichier.
Mettez simplement tous les codes suivants dans un seul fichier, et le suffixe du fichier doit être ASP.
<%
thedir = request ("thedir")
ifthedir = "" alors
Folderini = server.mappath (".") & "/"
autre
Folderini = server.mappath (thedir) & "/"
endire
FolLinfo = TRIM (request.Querystring ("Folinfo"))
iffoldinfo = "" alors
Folinfo = Folderini
endire
classesclsup
DimForm, fichier
Dimallowext_
Dimnoallowext_
Privateoupfilestream
Primiturer_
PrivaterMessage_
PrivateRisgetData_
PublicPropertygetVersion
Version = "v1.0.0"
Endproperty
Publicpropertygeterr
iSerr = iSerr_
Endproperty
PublicpropertygetherrMessage
ErrMessage = errMessage_
Endproperty
Publicpropertygetallowext
AllowExt = allowExt_
Endproperty
PublicProperTyletAllowExt (valeur)
AllowExt_ = lCase (valeur)
Endproperty
PublicPropertyGetNoAllowExt
Noallowext = noallowext_
Endproperty
PublicProperTyletNoAllowExt (valeur)
Noallowext_ = lcase (valeur)
Endproperty
PrivésubClass_Initialize
iSerr_ = 0
Noallowext = ""
NoallowExt = lCase (noallowext)
AllowExt = ""
AllowExt = lCase (allowExt)
isgetData_ = false
Fin
PrivésUbclass_termince
oneErrorResumeNext
Form.removeall
SetForm = rien
File.removeall
SetFile = rien
oupfilestream.close
SetoupFileStream = rien
Fin
PublicsubGetData (MaxSize)
oneErrorResumeNext
ifisgetData_ = falsethhen
DIMGETUPDATA1, SSPACE, BCRLF, SINFO, IINFOSTART, IINFOEND, TSTREAM, ISTART, OFILEINFO
Dimsformvalue, sfilename
Dimifinindstart, ifIndend
DIMIFIOTSTART, IFORMEND, SOFFOR
IfRequest.TotalBytes <1Then
iSerr_ = 1
ErrMessage_ = ""
Otestub
Endire
IfmaxSize> 0ment
Ifrequest.totalbytes> maxsizethen
iSerr_ = 2
ErrMessage_ = ""
Otestub
Endire
Endire
SetForm = server.createObject ("scripting.dictionary")
Form.comparemode = 1
SetFile = server.createObject ("scripting.dictionary")
File.comparemode = 1
SetTStream = server.createObject ("adodb.stream")
SetoupFileStream = server.createObject ("adodb.stream")
oupfilestream.type = 1
oupfilestream.mode = 3
oupfilestream.open
oupfilestream.writerequest.binaryread (request.totalbytes)
oupfilestream.position = 0
getUpData1 = oupFileStream.read
iformend = oupfilestream.size
bcrlf = chrb (13) & chrb (10)