• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

Copy File from www or ftp server

I need help createing a function like the copyFile function but i need to be able to copy the file from a web location or a web location.
0
wqclatre
Asked:
wqclatre
  • 3
1 Solution
 
calinutzCommented:
0
 
calinutzCommented:
As for ftp transfers... why not consider Indy components... they are very easy to use for easy jobs like this:
Place a idFtp component on the form ... set the propertyes like hostname, user and password... and then
in an onButton Event place this code:
idFtp1.Connect(True,500);
IdFTP1.ChangeDir('lala');
IdFTP1.Get('pkg.txt','C:\pkg.txt',True);
0
 
wqclatreAuthor Commented:
Already did the www thing by using idHTTP from indy.

Pretty easy.

Stream:= TMemoryStream.Create;
IdHTTP1.Get(URL,Stream);
Stream.SaveToFile(DestFileName);
Stream.Free;
0
 
calinutzCommented:
Isn't it the answer you wanted?
Didn't I answer to both your questions?
Then why the B grade?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now