Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remote File Exists?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows Server 2012
Network:
Windows NT
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01607766
Message ID:
01608073
Vues:
117
An even easier way and more universal maybe using HTTP is to just hit the URL where the file might exist via http and then check for an HTTP 404 error (Not found). Http since it's stateless is easier and doesn't require an FTP server.
DO wwHttp  && load libs

LOCAL loHttp as wwHttp
loHttp = CREATEOBJECT("wwHttp")

loHttp.HttpGet("http://west-wind.com/wconnect/InvalidFile.html")

*** "Not Found"
? loHttp.cErrorMsg

*** "404"
lcStatus = loHttp.cResultCode
? lcStatus

IF lcStatus = "404"
   ? "File not found on server"
ENDIF
Depends though whether you can get at the flles you need to via either HTTP or FTP... Either requires a server.

+++ Rick ---

>What's the best way to see if a certain "Remote file Exists?" (in a folder such as /public_html/images)
>Using HTTP or FTP or however else. Doesn't matter.
>
>Been working hard on writing code for WinINet to do the same thing. So far, I've got the ftp connection, changing folders, etc. all working.
>But for the life of me, I can't figure out how to use the FtpFindFirstFile() function. Just not enough description or sample code to understand it.
>
>Any help would be greatly appreciated.
>
>Thanks.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform