Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check if file exists... 1

Status
Not open for further replies.

guineamation

Programmer
Jan 29, 2002
58
IL
Hi all,

when trying to check if file exists on the server, like so:
Code:
   Set FilePDF = Upload.Files("frm_PDF")
   path = "/pdf/" & sItemName

    If Not Upload.FileExists(path) Then 
	 response.write "pdf not exists, uploading"&"<BR>"
	 FilePDF.SaveAsVirtual path  
    Else
         response.write "pdf exist"&"<BR>"
    End If
I always I get Upload.FileExists(path) -> flase, even when the file exists.

anyone?
 
you could try something like this

Code:
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

If (fs.FileExists(server.mappath(path))=true Then
      Response.Write(path &" exists.")
Else
      Response.Write(path &" does not exist.")
End If

set fs=nothing
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top