Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to open a internet-file ?
Message
From
10/02/2002 06:06:26
 
 
To
10/02/2002 05:39:40
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00617988
Message ID:
00617993
Views:
23
>Hi there,
>
>i want to open a simple webfile like
>http://www.test.de/hallo.txt (with VFP 5).
>
>With fopen("http://www.test.de/hallo.txt"), it doesn't work.
>Please help.
>

You need to resolve the URL to a UNC in the form \\ServerName\ShareName\path relative to the share so that you can instruct VFP to treat it as a conventional file. Windows is not capable of directly accessing a file using the HTTP protocol to host Windows file handling; you need to use RAS to establish the connection.

You'll need to convert the Web address to the name of the machine and a share on that machine. WinNT, Win2K and WinXP supportUNCs which address the server using an IP address; Win9x systems have to reference UNCs based on a NetBIOS name, so it's probable that you'll need to use the LMHOSTS file to assign a NetBIOS name to the Web server's IP address, and will need to know the share name on the server. While it's possible to resolve the DNS name to an IP address, you still need to wit, and will probably have to explicitly permit the server to share the file to anonymous users through the Internet.

HTTP protocol does not directly support standard Windows file operations. I'd recommend that you read Rick Strahl "Internet Applications with Visual FoxPro 6.0" published by Hentzenwerke. Rick sells software which integrates Web-based file operations done with VFP through his site www.west-wind.com for a fair price.

>If the problem is solved, i can code an automatic UPDATE-HANDLER, which checks if a new version is available on web and then downloads the file (+ start i.e. update program).
>
>Are there any better ideas ?
>
>Best Regards
>
>Jürgen Friedl
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform