Jump to content


Photo

Remoteexists


  • Please log in to reply
8 replies to this topic

#1 ATY

ATY
  • Members
  • 4 posts

Posted 06 May 2005 - 09:08 AM

Hi all,
First of all, sorry for my crappy English, It's my second language.
I am new to this forum and Cuteftp pro.
Anyway, I tried to write a script to download files from a server to my local PC. Filename are variable. How could i verify if files are existing? Below is the codes. Thanks for your help.

Set MySite = CreateObject("CuteFTPPro.TEConnection")
MySite.Protocol = "FTP"
MySite.Host = "xxx.xxx.xxx.xxx"
MySite.Port = 21
MySite.Login = "test"
MySite.Password = "test"
MySite.Connect

R=Mysite.localExists ("/test/from/*.txt")
If ® Then
'msgbox "file exist" 'test if the file exists
MySite.Download "/test/from/gcs*", "c:\data"
Else
'''Msgbox "File doesn't exist1 on client site"
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "xxxx@hotmail.com"
objEmail.To = "xxx.xxx@xxx.com"
objEmail.Subject = "test"
objEmail.Textbody = "test"
objEmail.Send

End if

#2 TCH-Thomas

TCH-Thomas

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 14,907 posts

Posted 06 May 2005 - 09:11 AM

Welcome to the forum, ATY. :naughty:
Sorry, donīt know the answer to this. :(

And your english is fine. ;)

Thomas Jikrantz
Forum Moderator
TotalChoice Hosting, Inc.

Any links or suggestions for third party software/sites should be used at your own risk. My opinions and recommendations are not necessary those of TCH and TCH is not responsible.

As a Forum Moderator I can assist in answering many of your hosting related questions. However, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.
Web Hosting by Total Choice Web Hosting - 24/7 Help Desk


#3 j2k4b

j2k4b

    Immediate Family

  • Members
  • PipPipPipPip
  • 321 posts

Posted 06 May 2005 - 09:47 AM

Welcome to the forums... Glad to have ya!

#4 TCH-Bruce

TCH-Bruce

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 19,960 posts

Posted 06 May 2005 - 10:07 AM

Welcome to the forums ATY :naughty:

Sorry, don't know the answer either.

Bruce Richards
Forum Moderator
TotalChoice Hosting, Inc.
Webhosting by Total Choice Web Hosting - General Support Forum

I am a Forum Moderator. While I can assist in answering most of your hosting related questions, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.


#5 GuestSerpentineGuest

GuestSerpentineGuest
  • Guests

Posted 06 May 2005 - 11:05 AM

Have you tried

Set MySite = CreateObject("CuteFTPPro.TEConnection")
MySite.Protocol = "FTP"
MySite.Host = "xxx.xxx.xxx.xxx"
MySite.Port = 21
MySite.Login = "test"
MySite.Password = "test"
MySite.Connect

R = MySite.RemoteExists( "/pub/user/file.txt")

If Ū Then

MsgBox "File exists on remote side"
MySite.Download "/test/from/gcs*", "c:\data"


Else

MsgBox "File doesn't exist on remote side"
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "xxxx@hotmail.com"
objEmail.To = "xxx.xxx@xxx.com"
objEmail.Subject = "test"
objEmail.Textbody = "test"
objEmail.Send

End if


Note, I just combined what you gave with what I found at this site.

Your English is better than most of the people I know.

Edited by Serpentine, 06 May 2005 - 11:06 AM.


#6 ATY

ATY
  • Members
  • 4 posts

Posted 06 May 2005 - 11:18 AM

Serpentine,
Yes i had tried the code below. This work only if you know the exactly file name
R = MySite.RemoteExists( "/pub/user/file.txt")

But in my case, I don't know the file name...

Thank you all for quick response.

#7 abinidi

abinidi

    Immediate Family

  • Members
  • PipPipPipPip
  • 1,420 posts

Posted 06 May 2005 - 11:40 AM

Sorry I don't know the answer, but welcome to the forums. I'm sure somebody around here will be able to help.
Paul Pehrson
Herriman, UT

Posted Image Posted ImagePosted ImagePosted ImagePosted Image



#8 TweezerMan

TweezerMan

    Immediate Family

  • Members
  • PipPipPipPip
  • 1,763 posts

Posted 06 May 2005 - 07:34 PM

Welcome to the forums, ATY! :)

I looked at the link Serpentine provided - it appears to me that if you don't know the file name(s), you'd first need to retrieve a directory listing with GetList, then you could download whatever filenames appear in the listing.
David Phillips (TweezerMan)
The Tweezer's Edge v3

#9 stevevan

stevevan

    Immediate Family

  • Members
  • PipPipPipPip
  • 3,522 posts

Posted 06 May 2005 - 08:43 PM

Welcome to the forums!
Steve, W4SJV

"When all else fails (and it will)...there's Amateur Radio!"
"It is better to let people THINK you're a fool than to open your mouth and remove all doubt."




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users