<% 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 %> KRI INTRANET
<%=tmp_name%>
<% tmp_folder_link = "" 'Response.Write tmp_folder(2,0) for j = 1 to ubound(tmp_folder) %> <% if tmp_folder(j,0) <> "" then %>
<% tmp_subject_folder = "" tmp_aa = split(tmp_folder(j,0), "\") tmp_subject_cnt = left(tmp_aa(ubound(tmp_aa)), 1) tmp_subject_name = "
" & tmp_aa(ubound(tmp_aa)) tmp_link = tmp_folder(j,0) %> <%=tmp_subject_name%>
<% tmp = 0 tmp_folder(j,0) = replace(tmp_folder(j,0),"\","/") 'Response.Write RootDir & "
" 'Response.Write tmp_folder(j,0) & "
" 'Response.Write mid(tmp_folder(j,0), len(RootDir) + 1, len(tmp_folder(j,0)) - len(RootDir)) & "
" tmp_tmp_folder = mid(tmp_folder(j,0), len(RootDir) + 1, len(tmp_folder(j,0)) - len(RootDir)) 'Response.Write tmp_tmp_folder & " " & instr(1, tmp_tmp_folder, "/") & "
" '------------------------------------------------------ '6개 폴더중에 한폴더의 모든걸 다운로드 하고플 때 (대신 해당 폴더의 root에 파일이 존재해야 에러가 없음, 폴더만 있으면 에러) '예) 6Man 폴더 밑에 폴더 뿐만 아니라 파일이 존재해야 함 'if instr(1, tmp_tmp_folder, "/") then ' 'else ' tmp_folder_link = tmp_folder(j,0) 'end if '수정본 if left(tmp_tmp_folder, 4) = tmp_tmp_folder_base then else tmp_folder_link = tmp_folder(j,0) tmp_tmp_folder_base = left(tmp_tmp_folder, 4) end if '------------------------------------------------------ '------------------------------------------------------ '선택한 현 폴더와 그 하위 폴더만 다운로드 하고플 때 '한글 폴더 전달이 안되넹.. ㅠ.ㅠ 'if isnumeric(left(tmp_tmp_folder, 1)) then ' tmp_folder_link = tmp_folder(j,0) 'else ' 'end if '------------------------------------------------------ 'Response.Write j & " " & tmp_folder_link & "
" for i = 1 to ubound(tmp_folder,2) if tmp_folder(j,i) <> "" then if tmp_downok = 1 then Response.Write "" & tmp_subject_folder & tmp_folder(j,i) & "
" else Response.Write tmp_subject_folder & tmp_folder(j,i) & "
" end if tmp = 1 end if next 'if tmp = 0 then 'Response.Write "
파일이 없습니다
" 'end if %>
<% end if %> <% next %>