Skip to content

Filenames with single quotes #96

Description

@Frank-Bemelman

I'm using this library and it works perfect for my application.
I have use ESP32S3 with 8MP PSRAM and SD card, using Arduino IDE.

I noticed that deleting filename like Gordon's Bay_ZA.txt did not work, as the single quote ' is treated as a path seperator.
I am not sure in what cases a single quote is actually used as a file seperator, could not find any references about that particular use.

In FtpServer.cpp at line 2259:

// replace single quote (') with slash to normalize path separators
    if( c == '\'' ) {
      c = '/';
    }

So, what I did, is commented out the above lines.

That works for me, now I can delete, upload, download such filenames. Quite possible nobody ever encountered this, because in an embedded system you usually use filenames without those special characters. In my case, it was an SD card also used on a PC, where such filenames occur more often.

I also increased FTP_BUF_SIZE from 2048 to 8192. My ESP has plenty of memory, and it seems to speed things up a bit with larger files.

Anyway, maybe helpful to others, when experiencing problems which filenames containing single quotes.

Thanks for this library,
Cheers, Frank

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