Skip to content

Problems when using IIS server (Windows Server) #12

@vladkorotnev

Description

@vladkorotnev

I have an IIS FTP server which seems to be working fine according to manual input over Telnet.

230 User logged in.
SIZE /Music/10_Digitalized_Lossless
550 Access is denied. 
SIZE /Music/190204_04.WAV
213 58757732
QUIT
221 Goodbye.
Connection closed by foreign host.

However, when using TinyFTPClient, all files are returned as directories.

For testing, I've tried to modify the objectType method like this to log the parameter and response:

  ObjectType objectType(const char *file) {
    FTPLogger::writeLog(LOG_DEBUG, "FTPBasicAPI", "objectType");
    const char *ok_result[] = {"213", "550", nullptr};
    ObjectType result = TypeDirectory;
      ESP_LOGW("size request", "FILE[%s]", file);
    if (cmd("SIZE", file, ok_result)) {
      ESP_LOGW("size res", "FILE[%s] RESPONSE[%s]", file, result_reply);
      if (strncmp(result_reply, "213", 3) == 0) {
        result = TypeFile;
      }
    }
    return result;
  }

This produces the following log:

FILE[/Music/moh
] RESPONSE[550 The filename, directory name, or volume label syntax is incorrect. 

Looks like the library is not trimming off the \r\n properly on Windows Server machines, leaving the \r behind.

I'll try to make a PR if I get around to it but for now logging this here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions