Thread View: borland.public.cppbuilder.internet.socket
3 messages
3 total messages
Started by LarryJ
Sun, 04 Sep 2005 16:43
IdHTTP
Author: LarryJ
Date: Sun, 04 Sep 2005 16:43
Date: Sun, 04 Sep 2005 16:43
10 lines
1230 bytes
1230 bytes
I am using the Indy component IdHTTP for the first time. I need to download
a .csv text file as seen below. After I run the Get( ) how do tell IdHTTP to
save the file to a specific directory?
IdHTTP1->Get("http://itable.finance.yahoo.com/table.csv?a=7&b=27&c=2004&d=7&e=27&f=2005&s=ibm&y=0&g=d&ignore=.csv");
Thanks
Larry
Re: IdHTTP
Author: Hans Galema
Date: Mon, 05 Sep 2005 08:15
Date: Mon, 05 Sep 2005 08:15
12 lines
1427 bytes
1427 bytes
LarryJ wrote: > I am using the Indy component IdHTTP for the first time. I need to download > a .csv text file as seen below. After I run the Get( ) how do tell IdHTTP to > save the file to a specific directory? http://www.google.nl/advanced_group_search?hl=en Find messages with the exact phrase: IdHTTP1->Get Return only messages from the group: *cppbuilder* Severral links will give you an answer. Hans.
Re: IdHTTP
Author: Remy Lebeau (TeamB)
Date: Tue, 06 Sep 2005 05:40
Date: Tue, 06 Sep 2005 05:40
37 lines
1934 bytes
1934 bytes
"LarryJ" <LarryJ33@ev1.net> wrote in message
news:431b23f9@newsgroups.borland.com...
> I am using the Indy component IdHTTP for the first time. I need to
> download a .csv text file as seen below. After I run the Get( ) how
> do tell IdHTTP to save the file to a specific directory?
By first opening a TFileStream for the desired local file and then passing
that TFileStream to Get() so that it can fill in the local file with the
downloaded data, ie:
TFileStream *fStream = new TFileStream("c:\\some folder\\table.csv",
fmCreate);
try
{
try
{
IdHTTP1->Get("http://itable.finance.yahoo.com/table.csv?a=7&b=27&c=2004&d=7&
e=27&f=2005&s=ibm&y=0&g=d&ignore=.csv", fStream);
}
__finally
{
delete fStream;
}
}
catch(const Exception &)
{
DeleteFile("c:\\some folder\\table.cvs");
}
The version of Get() that you are currently using is returning the
downloaded data as an AnsiString that you are ignoring in your code.
Gambit
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads