🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8199

Re: How to download a file WITHOUT using the FTP..only through HTTP..

#8199
From: Remy Lebeau (TeamB)
Date: Mon, 15 Nov 2004 17:50
35 lines
2371 bytes
"Oren Halvani" <Spam@Me-Please.com> wrote in message
news:41984e1e@newsgroups.borland.com...

> so, my question: how can i download a file via:
> InternetOpen( ), InternetConnect, InternetOpenFile( ), etc...

You didn't read the documentation for those functions, did you?  Your
answers are already answered in the documentation, especially for
InternetConnect() in particular.

>    HINTERNET handle_Connect = InternetConnect(handle_Session,
"ftp.halvani.de",
>                                             INTERNET_DEFAULT_FTP_PORT,
>                                             "USER", "PASS",
>                                             INTERNET_SERVICE_FTP, 0, 0);

Change that to this instead:

    HINTERNET handle_Connect = InternetConnect(handle_Session,
"http://www.theserver.com",
            INTERNET_DEFAULT_HTTP_PORT,
            "USER", "PASS",
            INTERNET_SERVICE_HTTP, 0, 0);

>       if(FtpGetFile(handle_Connect, txtRemoteFile->Text.c_str(),
> txtLocalFile->Text.c_str(),
>            FALSE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_ASCII, 0))

Just as there are FTP-related functions available, there are also several
HTTP-related functions available as well.  In this case, you need to use
HttpOpenRequest() and HttpSendRequest() instead of FtpGetFile().


Gambit
Technical Details
Message-ID: <4198ebfe$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41984e1e@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,f57c5862d590fb6d
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <41984e1e@newsgroups.borland.com>
Subject: Re: How to download a file WITHOUT using the FTP..only through HTTP..
Date: Mon, 15 Nov 2004 09:50:29 -0800
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <4198ebfe$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1100540926 68.69.17.41 (15 Nov 2004 09:48:46 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail