home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / iichkpath.asp < prev    next >
Text File  |  1997-11-12  |  902b  |  41 lines

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