Board index » delphi » ftp getting err msg

ftp getting err msg


2006-06-24 07:50:27 AM
delphi166
I'm testing some ftp code locally (not connected to the internet yet at
work, so am doing what I can with the laptop I brought in), and when I set
up a TIdFTP component with:
BoundIP := '127.0.0.1';
{ the username and password I use to log on to the laptop }
User := 'BlackbirdCrowRaven';
Password := 'HokaHey';
//and then call connect and get:
Connect;
ChangeDir('Miscellaneous');
Get('CrazyHorse.xml');
I get "550 The system cannot find the file specified"
I've tried everything imaginable for the ChangeDir value:
ChangeDir('C:\Miscellaneous');
ChangeDir('C:\Miscellaneous\');
ChangeDir('/Miscellaneous/');
ChangeDir('Miscellaneous/');
ChangeDir('Miscellaneous');
ChangeDir('/Miscellaneous');
ChangeDir('\Miscellaneous');
ChangeDir('\Miscellaneous\');
but I always get the same error message. Is ftping illegal using localhost?
Does it have to be an "Ftp server" machine for it to work? Or what is my
problem? (careful now...)
BTW, I copied this code from working code from a former project (except that
in that case where it worked, the file was "gotten" from a remote machine,
and, of course, the filenames and passwords, etc. were all different).
--
Be the first one on your block to read the uproariously hilarious novel "the
Zany Time Travels of Warble McGorkle" (Book 2 in a trilogy). Download it
here: codecentral.borland.com/item.aspx
 
 

Re:ftp getting err msg

"Blackbird Crow Raven" <XXXX@XXXXX.COM>writes
Quote
BoundIP := '127.0.0.1';
Get rid of that. You do not need it, nor should you be using it for local
connections anyway.
Quote
I get "550 The system cannot find the file specified"
Which server are you using? How do you have the server configured? What is
the Home Directory for the account? Assuming the Home Directory is set to
"C:\", does "C:\Miscellaneous\CrazyHorse.xml" actually exist?
Quote
I've tried everything imaginable for the ChangeDir value:
<snip>
but I always get the same error message.
Then your FTP server is likely not configured properly in the first place.
Quote
Is ftping illegal using localhost?
No. If it were, you would be getting different errors.
Quote
Does it have to be an "Ftp server" machine for it to work?
No. But you do need a running FTP server application.
Gambit
 

Re:ftp getting err msg

"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes
Quote

>BoundIP := '127.0.0.1';

Get rid of that. You do not need it, nor should you be using it for local
connections anyway.
OK
Quote
>I get "550 The system cannot find the file specified"

Which server are you using? How do you have the server configured? What
is
the Home Directory for the account? Assuming the Home Directory is set to
"C:\", does "C:\Miscellaneous\CrazyHorse.xml" actually exist?
I'm not using a server; I am just testing some code by trying to move a local
file to a different local directory. What I eventually need to do is
programattically move files each day from a remote machine to the local one.
I will know what directory they will be placed in, and the format of the
file name.
Quote
>I've tried everything imaginable for the ChangeDir value:
<snip>
>but I always get the same error message.

Then your FTP server is likely not configured properly in the first place.
Quite likely, since I don't have an ftp server running at all, at least not
to my knowledge/not deliberately. Perhaps there's a better/easier way to do
what I am doing than using ftp. All I need to do is move some files from a
remote computer (I think it will be a Linux box) to a Windows machine.
--
Be the first one on your block to read the uproariously hilarious novel "the
Zany Time Travels of Warble McGorkle" (Book 2 in a trilogy). Download it
here: codecentral.borland.com/item.aspx
 

Re:ftp getting err msg

Quote

Quite likely, since I don't have an ftp server running at all, at least
not
to my knowledge/not deliberately.
Well, it the 'connect' is not excepting, you do have an ftp server,
somewhere. You absolutely do need to have one :)
As Remy says, your local FTP server, (presumably the Windows FTP service),
probably does not have permissions for C:\ by default.
Quote
Perhaps there's a better/easier way to do
what I am doing than using ftp. All I need to do is move some files from a
remote computer (I think it will be a Linux box) to a Windows machine.
The Linux box will almost certainly have an FTP server running. The
permissons/privileges issue will apply on that box as well, perhaps even
more so since the Unix default position on almost everything is
'insufficient privilege' or 'Access denied' <g>
Rgds,
Martin
 

Re:ftp getting err msg

Quote
Well, it the 'connect' is not excepting, you do have an ftp server,
somewhere. You absolutely do need to have one :)
I have to agree here. MY first thought was 'He hasn't even got an FTP
server' but MArtin is correct. Obviously you have managed to connect in
order to get a permissions error. Obviously you have connected to an FTP
server but there is not permission to access the requested directory.
Quote
As Remy says, your local FTP server, (presumably the Windows FTP service),
probably does not have permissions for C:\ by default.

>Perhaps there's a better/easier way to do
>what I am doing than using ftp. All I need to do is move some files from a
>remote computer (I think it will be a Linux box) to a Windows machine.
Sounds about right. Why don't you consider copying the files programatically
over the network instead of using FTP?
Use Copyfile and then the local/network paths - I don't see why this would
not work..
Jamie
 

Re:ftp getting err msg

"Martin James" <XXXX@XXXXX.COM>writes
Quote
>

As Remy says, your local FTP server, (presumably the Windows FTP service),
probably does not have permissions for C:\ by default.
How do I add that permission?
--
Be the first one on your block to read the uproariously hilarious novel "the
Zany Time Travels of Warble McGorkle" (Book 2 in a trilogy). Download it
here: codecentral.borland.com/item.aspx
 

Re:ftp getting err msg

"Jamie Dale" <XXXX@XXXXX.COM>writes
Quote

Sounds about right. Why don't you consider copying the files
programatically over the network instead of using FTP?
Use Copyfile and then the local/network paths - I don't see why this would
not work..
Yes, I think I probably will go that route, provided that that is possible
when the source computer is running Linux. Is it?
The problem with a lot of the stuff we're doing (replacing existing software
created by an outside party with our own) is that we are tending to copy
their way of doing things, and in this case they are ftping the files over.
--
Be the first one on your block to read the uproariously hilarious novel "the
Zany Time Travels of Warble McGorkle" (Book 2 in a trilogy). Download it
here: codecentral.borland.com/item.aspx
 

Re:ftp getting err msg

Blackbird Crow Raven writes:
Quote
>As Remy says, your local FTP server, (presumably the Windows FTP
>service), probably does not have permissions for C:\ by default.

How do I add that permission?
You don't need to. You create an account whose home directory is where you
get/put the files. When you log on to an FTP server you automatically are
put into your home directory. Another possibility is to create a virtual
ftp directory which maps to C:\someplace.
When you open C:\ for any account, you're likely to open the whole drive.
Do not do that. (And it shouldn't work on a well-secured Linux box anyway)
If Linux runs samba you're lucky, then you can simply use CopyFile() as
suggested by Jamie Dale.
--
Ben
 

Re:ftp getting err msg

Quote
If Linux runs samba you're lucky, then you can simply use CopyFile() as
suggested by Jamie Dale.
I was just about ot post 'Run samba on the linux box' <g>
Rgds,
Martin
 

Re:ftp getting err msg

Quote
>>As Remy says, your local FTP server, (presumably the Windows FTP
>>service), probably does not have permissions for C:\ by default.
>
>How do I add that permission?

You don't need to.
More to the point, you don't want to!.
Setting permission to the root of the c: drive poses numerous security
issues and also system stability. You should not do this unless you can be
110% sure that no-one will gain access to the FTP user account/server.
If you still want to proceed, then in the words of microsoft; "Contact your
system administrator" :-P
Jamie
 

Re:ftp getting err msg

Jamie Dale writes:
Quote
More to the point, you don't want to!.
I didn't mean to sound patronising, but I agree 100%. :)
--
Ben
 

Re:ftp getting err msg

"Blackbird Crow Raven" <XXXX@XXXXX.COM>writes
Quote
I'm not using a server
Then what are you connecting to in the first place? You can not use the FTP
protocol without an FTP server to manage the files. You cannot connect an
FTP client to the file system directly. You should have been getting an
error from TIdFTP.Connect() trying to connect to a non-existent server. The
only way it wouldn't error is if you actually do have an FTP server running
on your local machine, and just don't realize it.
Quote
What I eventually need to do is programattically move files each
day from a remote machine to the local one.
FTP is good for that. But you would need an FTP server running on the
remote machine in order to gain access to the remote machine's files.
Alternatively, if the remote machine is always on the same network as your
client, then you could just share the remote folders on the network and then
use UNC paths with the CopyFile() function.
Quote
Quite likely, since I don't have an ftp server running at all, at least
not to my knowledge/not deliberately. Perhaps there's a better/easier
way to do what I am doing than using ftp. All I need to do is move some
files from a remote computer (I think it will be a Linux box) to a
Windows machine.
Then use FTP, especially since you have Linux involved. Just install an FTP
server onto the remote machine. There are many choices available. You
could even write your own with Indy, which has a TIdFTPServer and supports
development for Linux (amongst other platforms)
Gambit
 

Re:ftp getting err msg

"Blackbird Crow Raven" <XXXX@XXXXX.COM>writes
Quote
How do I add that permission?
First, you need to identify what kind of server you actually have installed
to begin with. Different server applications are configured differently
from each other.
Gambit
 

Re:ftp getting err msg

Quote
Alternatively, if the remote machine is always on the same network as your
client, then you could just share the remote folders on the network and
then
use UNC paths with the CopyFile() function.
Heh, Remy I already suggested that :-P
beat ya to it ;-)
Jamie
 

Re:ftp getting err msg

"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes
Quote

First, you need to identify what kind of server you actually have
installed
to begin with. Different server applications are configured differently
from each other.
I didn't install anything "on purpose"--whatever Windows 2000 comes with. Of
course, that is just my temporary dev machine, which does not even have a
network connection. When my real dev machine finally gets set up, it will be
XP, and will be able to connect to the server that really houses the files
to be copied.
--
Be the first one on your block to read the uproariously hilarious novel "the
Zany Time Travels of Warble McGorkle" (Book 2 in a trilogy). Download it
here: codecentral.borland.com/item.aspx