Discussion:
FTP uploads...pullin out my hair...please help
(too old to reply)
dave
2008-06-06 20:17:26 UTC
Permalink
I guess i am not smart enough to get my head around the logic of multiple
file/folder uploads.
Basically, i want the user to be able to drag and drop any files/folders etc
that they want to upload. Then my app should create all neccessary
directories(they can also be multiple levels deep), and upload all files to
those directories. I would also like to be able to give them the option to
overwrite or skip if the file exists.
Remy/Gambit helped me to understand where to look for the existence of files
and folders, but i cannot seem to figure out how to implement this to upload
multiple level files/folders, with the automatic creation of folders if
needed.

The indy example does not cover this(that i could see), so i would be ever
so greatful if someone could help me with this. I have been trying to wrap
my head around the logic for this for a few hours now, and am totally lost.
i am using a VirtualExplorerListview(not sure right now who made this) and a
jvDragandDrop component to get the list of files/directories. Also using
jvFindFiles to get files in subdirectories of the selected directories.

If anyone at all has some help for me, thank you in advance!

Dave
Remy Lebeau (TeamB)
2008-06-06 21:54:47 UTC
Permalink
Post by dave
Remy/Gambit helped me to understand where to look for the existence
of files and folders, but i cannot seem to figure out how to implement
this to upload multiple level files/folders, with the automatic creation
of folders if needed.
You need to implement your uploading using a recursive function, ie
(pseudocode):

procedure TForm1.UploadDir(const Source, Target: String);
begin
IdFTP1.ChangeDir(Target);
for (each item in Source) do
begin
if (item is folder) then
begin
if (item does not exist on server) then
IdFTP1.MakeDir(item);
UploadDir(Source + '\' + item, item);
end else
IdFTP1.Put(Source + '\' + item);
end;
end;


UploadDir('c:\some folder', '/');


Gambit
dave
2008-06-09 13:50:21 UTC
Permalink
Thank you again Remy/Gambit. This will help alot as i try to figure this
out.

Dave
Post by Remy Lebeau (TeamB)
Post by dave
Remy/Gambit helped me to understand where to look for the existence
of files and folders, but i cannot seem to figure out how to implement
this to upload multiple level files/folders, with the automatic creation
of folders if needed.
You need to implement your uploading using a recursive function, ie
procedure TForm1.UploadDir(const Source, Target: String);
begin
IdFTP1.ChangeDir(Target);
for (each item in Source) do
begin
if (item is folder) then
begin
if (item does not exist on server) then
IdFTP1.MakeDir(item);
UploadDir(Source + '\' + item, item);
end else
IdFTP1.Put(Source + '\' + item);
end;
end;
UploadDir('c:\some folder', '/');
Gambit
Michael Justin
2008-06-07 09:03:14 UTC
Permalink
Post by dave
I guess i am not smart enough to get my head around the logic of
multiple file/folder uploads.
The Open Source BTVisualFTP component (based on Indy) includes support
for recursive up- and downloads:

http://sourceforge.net/projects/btvisualftp/

http://cc.codegear.com/Item/24525

Best Regards
--
Michael Justin
SCJP, SCJA
betasoft - Software for Delphi™ and for the Java™ platform
http://www.mikejustin.com - http://www.betabeans.de
dave
2008-06-09 13:49:38 UTC
Permalink
Going to check this out for sure, thanks.
I am still going to have to learn to do this myself as well, but this may
appease the higher-ups for now.

Dave
Post by dave
I guess i am not smart enough to get my head around the logic of multiple
file/folder uploads.
The Open Source BTVisualFTP component (based on Indy) includes support for
http://sourceforge.net/projects/btvisualftp/
http://cc.codegear.com/Item/24525
Best Regards
--
Michael Justin
SCJP, SCJA
betasoft - Software for Delphi™ and for the Java™ platform
http://www.mikejustin.com - http://www.betabeans.de
dave
2008-06-09 14:34:38 UTC
Permalink
when i try to install the package i get the following error:

[Fatal Error] dclBTVisualFTPD7.dpk(32): Required package 'Utilities_D7' not
found.

I am pretty sure this is an indy isuue, i have 10.2.3 installed, (delphi 7
pro), but i cannot find this file anywhere. Can someone tell me where i can
get this file from so that i may install this component?

Any help you can give would be greatly appreciated.
Dave
Post by dave
Going to check this out for sure, thanks.
I am still going to have to learn to do this myself as well, but this may
appease the higher-ups for now.
Dave
Post by Michael Justin
Post by dave
I guess i am not smart enough to get my head around the logic of
multiple file/folder uploads.
The Open Source BTVisualFTP component (based on Indy) includes support
http://sourceforge.net/projects/btvisualftp/
http://cc.codegear.com/Item/24525
Best Regards
--
Michael Justin
SCJP, SCJA
betasoft - Software for Delphi™ and for the Java™ platform
http://www.mikejustin.com - http://www.betabeans.de
Michael Justin
2008-06-11 07:22:42 UTC
Permalink
Post by dave
[Fatal Error] dclBTVisualFTPD7.dpk(32): Required package 'Utilities_D7'
not found.
Some issues heve been fixed and Indy 10.2.3 support has been added in
the Subversion code now. A binary release will follow in the next days.
I have also sent you a source snapshot by mail today.

Many thanks for your bug report!
Best Regards
--
Michael Justin
SCJP, SCJA
betasoft - Software for Delphi™ and for the Java™ platform
http://www.mikejustin.com - http://www.betabeans.de
Loading...