home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / iis4_03.cab / iichkpath.asp < prev    next >
Encoding:
Text File  |  1997-08-07  |  873 b   |  40 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <%Option Explicit %>
  3.  
  4. <%
  5. Const L_THEFILE_TEXT = "The file "
  6. Const L_THEPATH_TEXT = "The path "
  7. Const L_NOTEXIST_TEXT = " does not exist."
  8. Const L_ENTERFILENAME_TEXT = "Please enter a valid file name."
  9.  
  10. Const DIR = "0"
  11. Const FILE = "1"
  12.  
  13. Dim path, ptype, failed, FileSystem, errmsg
  14.  
  15. path=Request.QueryString("path")
  16. ptype=Request.QueryString("ptype")
  17.  
  18. failed = false
  19.  
  20. Set FileSystem=CreateObject("Scripting.FileSystemObject")
  21.  
  22. if ptype = FILE then
  23.     failed =  not FileSystem.FileExists(path)     
  24.     errmsg = L_THEFILE_TEXT & replace(path,"\","\\") & L_NOTEXIST_TEXT 
  25. else
  26.     failed = not FileSystem.FolderExists(path)
  27.     errmsg = L_THEPATH_TEXT & replace(path,"\","\\") & L_NOTEXIST_TEXT 
  28. end if
  29.  
  30. %>
  31.  
  32. <% if failed then %>
  33.     <SCRIPT LANGUAGE="JavaScript">
  34.         alert("<%= errmsg %>");
  35.     </SCRIPT>
  36. <% end if %>
  37.  
  38. <HTML>
  39. </HTML>
  40.