Skip to content

[Feature Request] Mark filenames with problematic characters or patterns #6202

Closed as not planned

Description

@mmattel

Setup:

  • a user has a connection to two external mounts in ownCloud. One is FTP (running on a linux derivate) the other one is SMB
  • those two mounts are synced via the sync client to local
  • the client runs in this case on mac, any other linux is the same, but not windows

Following situation:
*unix derivates allow/disallow different characters in filenames than windows. This can become a problem when moving/copying files from one local folder to another when the filename contains characters or words which can be forbidden in the target backend filesystem.
You have the file locally present in folder_ftp connected to mount_ftp. It is possible and allowed to move/copy the file to folder_smb which is connected to mount_smb because *unix allows this, but the sync client will fail syncing because ownCloud will respond back with an error not beeing able to upload to mount_smb.

The filename problem is setup and direction dependent:

  • Client and backend on Windows OK
  • Client and backend on *unix OK
  • Client on *unix but backend on Windows Problem <-- we address this one - upload situation
  • Client on Windows but backend on *unix different story because of download situation

Proposal:

  1. check for "problematic" characters/words in filenames during the sync process and treat them special.
  2. currently we have three symbols in the filebrowser (checkmark (green), in progress/ignored (yellow), fail (red)). Maybe a fourth symbol with magenta telling the user about this problem in the filesystem on the file in question
  3. mark the problematic files in the ignore list specially so they can be identified easily, highlighting also what was the problem character/word
  4. having a predefined list of problematic characters or words like the ignore list
  5. enable/disable checking by checkmark and/or OS detection

what-characters-are-forbidden-in-windows-and-linux-directory-names
https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names

1.) The forbidden printable ASCII characters are:

  • Linux/Unix: / (forward slash)
  • Windows: < (less than) > (greater than) : (colon - sometimes works, but is actually NTFS Alternate Data Streams) " (double quote) / (forward slash) \ (backslash) | (vertical bar or pipe) ? (question mark) * (asterisk)

2.) Non-printable characters. If your data comes from a source that would permit non-printable characters then there is more to check for.

  • Linux/Unix: 0 (NULL byte)
  • Windows: 0-31 (ASCII control characters) Note: While it is legal under Linux/Unix file systems to create files with control characters in the filename, it might be a nightmare for the users to deal with such files.

3.) Reserved file names. The following filenames are reserved:

  • Windows: CON, PRN, AUX, NUL COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9 LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9

4.) Other rules

  • Windows: Filenames cannot end in a space or dot

Update:
An implementation would require a new webdav property in core. Suggestion: isFsType [W,L]

Activity

  1. mmattel commented on Nov 30, 2017

    @mmattel
    ContributorAuthor

    @PVince81 maybe interesting to you too,

    • Case: when you try to move files from one mount to another inside ownCloud (not via the client)
    • Case: client on Windows but backend on *unix (download)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions