%
set rsp = server.CreateObject("ADODB.RECORDSET")
set rsf = server.CreateObject("ADODB.RECORDSET")
d_no = request("d_no")
dcode = request("dcode")
'Response.Write d_no & "
"
if dcode = "0" then
tmp_type = "consultation"
end if
Dim RootDir
Dim tmp_folder(50, 50)
tmp_y = right(year(date), 2)
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'파일 다운로드 가능여부를 체크
'tmp_downok가 1이면 다운가능 0이면 불가능
tmp_downok = 1
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'RootDir = "D:\project_db\data\" & tmp_y & "\consultation\" & d_no & "\"
RootDir = "D:\project_db\data\" & tmp_y & "\Document\" & tmp_type & "\"' & d_no & "\"
tmp_folder_cnt = 1
call getFolder(RootDir, 0, true, true)
'===================================================================
' func : getFolder(경로, 뎁스, 서브폴더, 파일)
' param :
' memo :
'===================================================================
function getFolder(sPath, iDepth, bSonFdr, bShowFile)
Dim fso, objFolder
Dim folders, folder
Dim files, file
Dim sSpace
sSpace = ""
for i=0 to iDepth
sSpace = sSpace & ":tab:"
next
'Response.Write sPath & " 1
"
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFolder = fso.GetFolder(sPath)
set fso = nothing
set folders = objFolder.SubFolders
Set files = objFolder.Files
set objFolder = nothing
For Each folder in folders
if instr(1, folder, d_no) then
'Response.Write folder & "
"
'해당 폴더의 파일
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFolder = fso.GetFolder(sPath & "\" & folder.name)
set fso = nothing
Set hfiles = objFolder.Files
'Response.Write sPath & folder.name & "
"
tmp_folder(tmp_folder_cnt,0) = sPath & folder.name
i = 1
For Each file in hfiles
tmp_folder(tmp_folder_cnt,i) = file.name
i = i + 1
Next
tmp_folder_cnt = tmp_folder_cnt + 1
'++ 하위폴더
if bSonFdr then
call getFolder(sPath & folder.name & "\", iDepth+1, bSonFdr, bShowFile)
end if
end if
Next
'++ 파일도 보여준다면
if bShowFile then
For Each file in files
'response.write sSpace& "[파]" &file.name & "
"& vbCRLF
Next
end if
end function
%>