hello,
I am using the native ftp functions from php and since the normal ftp_* doesn't give any feedback or responses, I am using the ftp_raw function to do all my commands.
For some reason after I upload or do an nlist, I only get the first line of response back from the control channel:
Then, when I do another command, I get the next line from the previous command:
But that response should have been part of the previous command's response. From that point forward, every response is off by one response. ftp_raw will continually return the response from the previous call, not the one just executed.
For example, here is a sample of the calls and the responses:
So you can see, after I issue the STOR command (which is the first command that returns multiple lines) and the file is uploaded (and I have confirmed that it does successfully upload the file), every command after that returns the response from the previous command.
Any help is greatly appreciated.
I am using the native ftp functions from php and since the normal ftp_* doesn't give any feedback or responses, I am using the ftp_raw function to do all my commands.
For some reason after I upload or do an nlist, I only get the first line of response back from the control channel:
Code:
150 Opening ASCII mode data connection for '/uploaded.txt'.
Then, when I do another command, I get the next line from the previous command:
Code:
226 Transfer complete.
But that response should have been part of the previous command's response. From that point forward, every response is off by one response. ftp_raw will continually return the response from the previous call, not the one just executed.
For example, here is a sample of the calls and the responses:
Code:
> USER username
331 Password required for username.
> PASS password
230 User username logged in, access restrictions apply.
> CWD /ftp_dir1
250 CWD command successful.
> PASV
227 Entering Passive Mode (123,45,67,89,111,22)
> STOR /uploaded.txt
150 Opening ASCII mode data connection for '/uploaded.txt'.
> PWD
226 Transfer complete.
> NOOP
257 "/ftp_dir1" is current directory.
> MDTM /uploaded.txt
200 NOOP command successful.
So you can see, after I issue the STOR command (which is the first command that returns multiple lines) and the file is uploaded (and I have confirmed that it does successfully upload the file), every command after that returns the response from the previous command.
Any help is greatly appreciated.