Switch to full style
ASP/ASP.net examples
Post a reply

check if file exists

Wed Mar 30, 2011 11:40 pm

Following code check if a file exists
Code:
<%
Dim objmyFileStream
Set objmyFileStream
= Server.CreateObject("Scripting.FileSystemObject")
If objmyFileStream.FileExists("c:\testCheck.txt") Then
Response
.Write "<b>File Found.</b>"
Else
Response.Write "Sorry , File not found"
End If 
Set objmyFileStream
= Nothing
%>  


how to move this a file
Code:


<%
Set objfileStream= CreateObject("Scripting.FileSystemObject")
objfileStream.MoveFile "c:\test.txt" , "c:\newtest.txt"
%>
 




Post a reply
  Related Posts  to : check if file exists
 file exists in upper level folder link     -  
 check existence of file or folder in asp     -  
 Encrypt/Decrypt a file from source file to target file.     -  
 check if number is odd or even     -  
 Check DNS error     -  
 check if domain name is taken by php     -  
 check empty number     -  
 check array contains a value using javascript     -  
 check folder content using asp     -  
 check keyboard events using C++     -  

Topic Tags

ASP Files and I/O