Link to home
Start Free TrialLog in
Avatar of Idarac
Idarac

asked on

Access VBA ftp

I have an Access application that I use to upload files to my remote server it works as a select the file one click operation. I am using calls to Winnet.dll api.

But now I want to be able to check if the file exists just to make sure the file got there and icing on the cake would be file size also.
Avatar of AccessGuy1763
AccessGuy1763

I think you just need to utilize FileLen() and Dir() to do these two things.

FileLen
Dir

I don't have anything written for File Size but I made a simple little function to return just True/False using Dir():

Public Function fcnFileExists(inFileToTest As String) As Boolean
    
    'This function will test to see if the passed in file exists.
    'It will return True if the file exists and False if not.
   
   'Check for file with Dir() and pass back result
   fcnFileExists = (Dir(inFileToTest) <> "")
   
End Function

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Idarac

ASKER

Worked great