Re: FTP problems continued

From: Janwillem Borleffs (jw_at_jwscripts.com)
Date: 11/11/03


Date: Tue, 11 Nov 2003 00:14:45 +0100


"Irvin Amoraal" <irvin@rcabletv.on.com> schreef in bericht
news:vqvf23qf1ca3df@corp.supernews.com...
>
> Below is the code for the whole page: When try to execute it, I get no
> error msgs from the fputs commands, but [code] if

The fputs function only return false when there is something terribly wrong
(e.g., connection to the server is lost).

When you want to know if the command was executed successful, you should
look at the response, e.g.:

fputs($fp, "cwd somedir");
if (!ereg("^250", fgets($fp, 1024))) echo "CWD failed";

Tip: telnet to your server through port 21, type in some commands and look
at the responses.

>
> I guess I'm all over the place in my comments here ... and I hate to ask
> this question, but why doesn't this work?
>

For starters, you are sending the cwd command before you have authenicated
yourself.

Look here for a working version:
http://www.jwscripts.com/playground/ftp3.php

JW



Relevant Pages

  • Re: ftp connection in VB.NET
    ... The goal here is to return a list of all the files and directories in an FTP ... ___ RESPONSE IS COMPLETE ... 200 PORT command successful. ... > server, then the cwd \directoryname will success, and now current ...
    (microsoft.public.dotnet.framework)
  • Re: Terminal services commandline utilities denied from programmatic access?
    ... appears that it tries to execute a wow64 qwinsta.exe on a 64 bit windows. ... and then receive the text response in a pipe. ... I have verified that 'qwinsta' is installed, and the above command works properly when manually typed from an "Administrator:" command prompt. ... the routine in my library fails to access 'qwinsta' when executed from within a test program - I receive the following output: ...
    (microsoft.public.windows.terminal_services)
  • sp_start_job problem....
    ... I am writing following command to execute the another job. ... In response of above I am receiving following Error Messege. ...
    (microsoft.public.cert.mcdba)
  • sp_start_job problem....
    ... I am writing following command to execute the another job. ... In response of above I am receiving following Error Messege. ...
    (microsoft.public.cert.exam.mcsa)
  • sp_start_job problem....
    ... I am writing following command to execute the another job. ... In response of above I am receiving following Error Messege. ...
    (microsoft.public.access.queries)