Board index » cppbuilder » Help with FTP Component using Indy 9 with BCB 2006!

Help with FTP Component using Indy 9 with BCB 2006!


2007-01-25 05:01:53 AM
cppbuilder30
I need some help with some scripting in reference to uploading a file with
the TIdFTP component... I am not sure as to how to upload the file
programmatically... I dont know how to use a file stream and I need help
with this topic... I remember in BCB 4.0 that there was a Upload function
that was something like: "FTP->Upload(<File Location>, <File Name>);" Could
someone possibly write a sample piece of code to upload a file that a user
selected from an OpenDialog component??? It would be much appreciated! For
your info, I am using the latest version of Borland Developer Studio 2006
and I am using Borland C++ Builder 2006 with Indy 9 to program...
Thank you,
Carl
 
 

Re:Help with FTP Component using Indy 9 with BCB 2006!

Nevermind, I have figured it out... Apparently you just use the "Put()"
function... It was very easy, I just overlooked the functions.... Example -
TIdFTP1->Put(<local file>, ExtractFileName(OpenDialog1->FileName));
"Carl Danley" < XXXX@XXXXX.COM >wrote in message
Quote
I need some help with some scripting in reference to uploading a file with
the TIdFTP component... I am not sure as to how to upload the file
programmatically... I dont know how to use a file stream and I need help
with this topic... I remember in BCB 4.0 that there was a Upload function
that was something like: "FTP->Upload(<File Location>, <File Name>);"
Could someone possibly write a sample piece of code to upload a file that a
user selected from an OpenDialog component??? It would be much appreciated!
For your info, I am using the latest version of Borland Developer Studio
2006 and I am using Borland C++ Builder 2006 with Indy 9 to program...

Thank you,
Carl

 

Re:Help with FTP Component using Indy 9 with BCB 2006!

"Carl Danley" < XXXX@XXXXX.COM >wrote in message
Quote
I am not sure as to how to upload the file programmatically...
Did you read the Indy documentation yet? Di you look at the Indy
demos?
Quote
I dont know how to use a file stream
What exactly don't you know?
Quote
I remember in BCB 4.0 that there was a Upload function that was
something like: "FTP->Upload(<File Location>, <File Name>);"
Since Indy did not ship with BCB 4, you are likely referring to the
Upload() method of the Netmasters TNMFTP component, which has nothing
to do with Indy.
In Indy, the method is called Put(), and there are two overloaded
versions of it:
void __fastcall Put(const TStream *ASource, const AnsiString
ADestFile = "", const bool AAppend = false);
void __fastcall Put(const AnsiString ASourceFile, const AnsiString
ADestFile = "", const bool AAppend= false);
Quote
Could someone possibly write a sample piece of code to upload a
file that a user selected from an OpenDialog component???
Look at the demos on Indy's website.
Gambit
 

{smallsort}