[SOLVED] FTP CD Command

I am trying to connect to an FTP site in order to upload a datalogger file. I have been using SurferTim's code found here: http://playground.arduino.cc/Code/FTP. The site I am using byethost31.com does not allow upload to the root directory. So my question is; How can I implement the CD command to be able to upload the file to a subdirectory?

DHResearch:
So my question is; How can I implement the CD command to be able to upload the file to a subdirectory?

Moste likely: Use a CD command before you STOR or RETR a file.

Sorry, I should have clarified. I sent the CD command after the "PASS" and after the "PASV" using the same code that is in the program, but it is reported as an unknown command by the FTP site. I had the same problem for LS. I am not sure if the code uses different commands that correspond to those I want (ie, a command like "DIR" corresponds to the "CD" command) or if I am implementing it incorrectly.

DHResearch:
Sorry, I should have clarified. I sent the CD command after the "PASS" and after the "PASV" using the same code that is in the program, but it is reported as an unknown command by the FTP site. I had the same problem for LS. I am not sure if the code uses different commands that correspond to those I want (ie, a command like "DIR" corresponds to the "CD" command) or if I am implementing it incorrectly.

I'd first try out all the commands by using a simple FTP tool.
Such like 'ftp.exe' which comes with Windows operating systems.
Watch out for the return codes!
Then, if all manually entered commands work as expected, code them for automatically playing with Arduino.

If uppercase commands like "CD" do not work, use lowercase commands like "cd".

The normal answer if you send something like "cd html" should read like
250 CWD command successful.

Use CWD, not CD. I use it after the SYST send. Change MyDirectory to the directory you want.

  client.write("SYST\r\n");

  if(!eRcv()) return 0;

  client.write("PWD\r\n");

  if(!eRcv()) return 0;

  client.write("CWD ./MyDirectory\r\n");

  if(!eRcv()) return 0;

  client.write("PWD\r\n");

  if(!eRcv()) return 0;

  client.write("PASV\r\n");

  if(!eRcv()) return 0;

Worked like a charm! Thanks very much for the help.