uploading all files of a directory

Posted by Jim on March 11, 2007

In Reply to UPLOAD IN DELPHI posted by Billy on February 24, 2007

: I want to upload all the files from on folder to a web page server on internet. The source below uploads the 2 files but is necessary to know their name. I want to upload all the files from the directory c:\temp without knowing what is inside. How is possible? Thank you.

Have a look at procedure FindFiles in the article on page www.festra.com/eng/snip04.htm

How to use it in your case:

FilesList := TStringList.Create;
FindFiles(FilesList, 'c:\temp', '*.*'); 
if FilesList.Count > 0 then begin
  for i := 0 to FilesList.Count - 1 do begin
    LocalFile := 'c:\temp\' + FilesList[i]; 
    // now upload the file:...

Related articles


Follow Ups