300 points for ASP traversal of the specified folder, spanning tree


Such
word , txt,Such as Excel can download
After the completion of the other with 200 points

Started by Taylor at November 06, 2016 - 1:13 AM



How did not see ah

Posted by Taylor at November 13, 2016 - 2:08 AM

Using FSO, Files directory traversal, find or write their own can step loading tree on the line
Mr. into a directory, deployment directory, asynchronous fetching, download is a path to the URL connection

Posted by Reed at November 20, 2016 - 2:33 AM

Directly to find a ASP system reference is....
A lot of back office functions of the...

Posted by Marshall at December 02, 2016 - 3:27 AM

High-end!
To move a small stool studies.

Posted by Bernard at December 13, 2016 - 3:55 AM

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Option Explicit
Response.CodePage=65001
Response.Charset="UTF-8"
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache" 
Response.AddHeader "Pragma", "No-Cache"
Dim file_url,fso,s_path,arr_ext,i_folder
s_path=Server.MapPath("/FUploadFile") 'The definition tree
arr_ext="txt,doc,jpg" 'Type definition can download files
'*************************************************
'Use: this procedure is the role of the direct download file not open in IE, such as HTM, TXT, ASP, JPG files etc.
'*************************************************
file_url=Request.QueryString("file")
If file_url<>"" Then
	'on error resume Next
	Dim Scs,ture_url,filename,exe_name,Range,file_name
	ture_url=server.MapPath(file_url)
	Set fso = CreateObject("Scripting.FileSystemObject")
	If Not fso.FileExists(ture_url) Then
		Response.write "<script>alert('Sorry, the file does not exist!');window.opener=null;window.open('','_self');window.close();</script>"
		Response.End
	ElseIf InStr(LCase(ture_url),LCase(s_path)) Then 'Safety, restricted to download the specified directory file
		file_name=Mid(ture_url,instrRev(ture_url,"\")+1) 'The file name with the suffix
		exe_name=Mid(file_name,instrRev(file_name,".")+1)'The name suffix
		filename=Mid(file_name,1,instrRev(file_name,".")-1)'File name
		Set Scs=CreateObject("Adodb.Stream")
		Scs.Mode=3
		Scs.Type=1
		Scs.Open
		Scs.LoadFromFile(ture_url)
		If InStr(arr_ext,exe_name)>0 Then
			Response.ContentType="application/octet-stream"
			If Instr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE")>0 Then filename=Server.URLEncode(filename)
			Response.AddHeader "Content-Disposition:","Attachment;filename="&filename&"."&exe_name
			Range=Mid(Request.ServerVariables("HTTP_RANGE"),7)
			If Range="" Then
				Response.BinaryWrite(Scs.Read)
			Else
				Scs.Postion=Clng(Split(Range,"-")(0))
				Response.BinaryWrite(Scs.Read)
			End If
		Else
			Response.write "<script>alert('Sorry, the file download prohibition');window.opener=null;window.open('','_self');window.close();</script>"
			Response.End
		End If
	Else
		Response.write "<script>alert('Sorry, you visit the area file!');window.opener=null;window.open('','_self');window.close();</script>"
		Response.End
	End If
End if

'*************************************************
'For use: the callback function, generated z-Tree data
'*************************************************
Sub sub_file(TruePath,pid)
	Dim fso,theFolder,File,Folder,i,this_id	
	If pid<>"0" Then Response.write ","
	this_id=i_folder+1
	Response.write "{id:"""&this_id&""", pId:"&pid&",name:"""&Mid(TruePath,instrRev(TruePath,"\")+1)&"""}"
	i_folder=i_folder+1
	Set fso = CreateObject("Scripting.FileSystemObject")
	Set theFolder=fso.GetFolder(TruePath)
		i=1
		For Each File In theFolder.Files
			i=i+1
			Response.write ",{id:"""&pid&"_"&i&""", pId:"""&this_id&""",name:"""&Mid(File,instrRev(File,"\")+1)&" ["&File.Size&"KB]"",url:""?file="&Replace(Replace(File,s_path,"/FUploadFile"),"\","/")&"""}"
		Next
		For Each Folder In theFolder.subfolders
			Call sub_file(Folder,this_id)
		Next
	Set fso = Nothing
End Sub
%><!DOCTYPE html>
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <TITLE> FSO spanning tree scscms</TITLE>    
    <link rel="stylesheet" href="zTreeStyle/zTreeStyle.css" type="text/css">
    <script type="text/javascript" src="zTreeStyle/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="zTreeStyle/jquery.ztree.all-3.5.min.js"></script>
	<script>
			var zNodes =[<%Call sub_file(s_path,"0")%>];
			var setting = {data: {simpleData: {enable: true}}}
			$(document).ready(function(){
				$.fn.zTree.init($("#treeDemo"), setting, zNodes);
			});
	</script>
</head>
<body>
<h2>The upload directory browsing</h2>
<ul id="treeDemo" class="ztree"></ul>
</body>
</html>

File download

Posted by Werner at December 15, 2016 - 4:40 AM

Some JS tree, adapted into ASP code.

Posted by Grace at December 26, 2016 - 5:00 AM



Have a look this.

Posted by Grace at January 03, 2017 - 5:15 AM


This split over to you 200

Posted by Taylor at January 12, 2017 - 6:07 AM

Must support a, thanks to the forum to provide such opportunities, learning about

Posted by Manda at January 14, 2017 - 7:06 AM