FTP - check if file exist (1 Viewer)

mdcory

Registered User.
Local time
Today, 06:44
Joined
Sep 28, 2004
Messages
73
Hi all.

I am using vba to upload files to an ftp server. After some tweaking and trail and error I have it working correctly except for one part. I am not sure how to make it find if the directory exist or not.

PHP:
Open "G:\script.ftp" For Output As #1
    Print #1, Replace("user_name|password|binary|mkdir " & strFTP1 & " mkdir " & strFTP2 & " mkdir " & strFTP3 & " mkdir " & strFTP4 & "|send " & Me.txt_orginal_loc & " |quit", "|", vbCrLf)
  Close #1
  
Shell "ftp -v -i -s:G:\script.ftp ftp_server.com"

Of course this works fine as long as the directory doesn't exist but if it does it will fail. I need to find a way to make it continue to try the next folder if it exists.

Thanks,
Matt
 

Users who are viewing this thread

Top Bottom