Click to See Complete Forum and Search --> : ini has files to download
Nathan Strandberg
May 1st, 1999, 07:59 PM
Ok, it seems that no one will help me with this but... I have an ini file uploaded on my server that contains the download location of all the files the program needs to run. How can I download that file, open it, read where the files are located then...Download them.
CAN SOMEONE PLEASE HELP ME!!!!
Thanks!
Nathan Strandberg
Mahanthi
May 6th, 1999, 03:26 PM
Hi there,
If you are still looking for a solution and haven't got any ideas yet, i have a solution for you. Please intimate me and i shall let you know the solution.
Regards
Mahanthi
mahanthi@rocketmail.com
LJP
May 7th, 1999, 12:26 AM
You might provide some more info, such as .. are you using MFC? wininet? chtml? Have you checked out the on line documentation at miscrosoft.com? Have you looked at other ftp programs sources to see if the solution is there?
Mahanthi
May 10th, 1999, 11:13 AM
Nathan Strandberg,
Well let me first list down the assumptions i am going to make.
There is a text file ( the name of the file could be "listing" with .ini extension ) in a web server.
This file has the URLs to files which are required to complete an installation. The URL is well formed URL along with the server name.
The Format of the INI file is known to us. This means that i can extract the URLs of the various files programmatically.
There is access to the web servers pointed to by the URLs in the INI file. Basically this means that there is access to the Web Servers wherein there are files which are needed to complete an installation.
Solution :
How to download the INI file from a known web server ?
Use the function URLDownloadToFile. Its prototype is
HRESULT URLDownloadToFile(
LPUNKNOWN pCaller,
LPCSTR szURL,
LPCSTR szFileName,
DWORD dwReserved,
LPBINDSTATUSCALLBACK lpfnCB
);
The advantage with this function is that you can specify a URL, a file name to store the page referred by the URL and you don't need to make use of Internet related classes at all. If you have IE on your machine, this function is part of the Internet SDK.
If this function is used, it will download the INI file onto your machine. You can specify the file name in which to store the INI file.
How to extract the URLs from the INI file ?
Parse the downloaded INI file and extract all the necessary URLs in the INI file ( This is the only time consuming job )
How to download the Files required to complete the installation ?
Once i have the list of the URLs of the Files to be downloaded, all i do now is iterate over them and call the function URLDownloadToFile even specifying the directory where i want to store the downloaded files.
By this time i would have got the files necessay to run the Setup.
Hope this helps, in case there are deviations in my assumptions please clarify and lets go from there.
Regards
mahanthi@rocketmail.com
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.