+ Reply to Thread
Results 1 to 4 of 4

How to check if a file exists in an ftp folder

  1. #1
    LL Cool A
    Guest

    How to check if a file exists in an ftp folder

    Hi all,

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

    Thanks.

  2. #2
    Jim Cone
    Guest

    Re: How to check if a file exists in an ftp folder

    Will you know the file path when the code is run?
    What is an ftp folder?
    --
    Jim Cone
    San Francisco, USA
    http://www.realezsites.com/bus/primitivesoftware


    "LL Cool A"
    wrote in message
    Hi all,
    Do any of you guys (and gals) know how to check via vb if a file in an ftp
    folder exists?
    Thanks.

  3. #3
    LL Cool A
    Guest

    Re: How to check if a file exists in an ftp folder

    Yes, I will know the file path. The folder is located on an ftp site.

    "Jim Cone" wrote:

    > Will you know the file path when the code is run?
    > What is an ftp folder?
    > --
    > Jim Cone
    > San Francisco, USA
    > http://www.realezsites.com/bus/primitivesoftware
    >
    >
    > "LL Cool A"
    > wrote in message
    > Hi all,
    > Do any of you guys (and gals) know how to check via vb if a file in an ftp
    > folder exists?
    > Thanks.
    >


  4. #4
    Jim Cone
    Guest

    Re: How to check if a file exists in an ftp folder

    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.

    "Jim Cone" wrote:
    > Will you know the file path when the code is run?
    > What is an ftp folder?
    > --
    > Jim Cone
    > San Francisco, USA
    > http://www.realezsites.com/bus/primitivesoftware
    >
    >
    > "LL Cool A"
    > wrote in message
    > Hi all,
    > Do any of you guys (and gals) know how to check via vb if a file in an ftp
    > folder exists?
    > Thanks.
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1