How to check if a file exists in an ftp folder

G

Guest

Hi all,

Do any of you guys (and gals) know how to check via vb if a file in an ftp
folder exists?

Thanks.
 
J

Jim Cone

Well, I am still ignorant, but give one or both of these a try
and see what happens.
Replace the file path shown in the function calls with the
correct file path.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


Sub CallFirstFunction()
Call FindFile("C:\Documents and Settings\user\My Documents\File Name.xls")
End Sub

Function FindFile(ByRef strPath As String)
Dim strFile As String
strFile = Dir(strPath)
If Len(strFile) Then
MsgBox "File Exists"
Else
MsgBox "File does not exist"
End If
End Function
'------------------

Sub CallSecondFunction()
MsgBox ReportFileStatus("C:\Documents and Settings\user\My Documents\File Name.xls")
End Sub

Function ReportFileStatus(filespec)
Dim fso As Object
Dim msg As String
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(filespec)) Then
msg = filespec & " exists. "
Else
msg = filespec & " doesn't exist. "
End If
ReportFileStatus = msg
Set fso = Nothing
End Function
'-----------------------------------



"LL Cool A"
<[email protected]>
wrote in message
Yes, I will know the file path. The folder is located on an ftp site.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top