|
| 1 | +.. _windows_compatible_filenames: |
| 2 | + |
| 3 | +============================ |
| 4 | +Windows compatible filenames |
| 5 | +============================ |
| 6 | + |
| 7 | +.. note:: |
| 8 | + |
| 9 | + This feature was introduced in Nextcloud 31. |
| 10 | + |
| 11 | +By default Nextcloud supports all filenames which are valid on the underlying server. |
| 12 | +As Nextcloud runs only on POSIX compatible operating systems (Linux), |
| 13 | +this means that Nextcloud supports also filenames not valid on Microsoft Windows systems. |
| 14 | + |
| 15 | +If your users use Windows and use the Nextcloud Desktop clients to synchronize their work |
| 16 | +to their computer they might encounter files created in the web interface, or on a Linux |
| 17 | +machine, which cannot be synchronized as the filename is not valid. |
| 18 | + |
| 19 | +To solve this issue it is possible to enforce filenames only valid on Windows, |
| 20 | +this for example forbids characters like ``*`` from filenames |
| 21 | +or filenames like ``AUX.txt`` (on Windows ``AUX`` is a reserved name and cannot be used). |
| 22 | + |
| 23 | +.. note:: |
| 24 | + |
| 25 | + Enabling this setting will not enforce case-insensitivity |
| 26 | + as modern Windows systems support case-sensitive filenames. |
| 27 | + |
| 28 | +Enabling Windows compatible filenames |
| 29 | +------------------------------------- |
| 30 | + |
| 31 | +This feature can be enabled either by using the web interface |
| 32 | +or by using an ``occ`` command. |
| 33 | + |
| 34 | +.. note:: |
| 35 | + |
| 36 | + This feature works by setting a predefined set of system configuration settings. |
| 37 | + So after enabling this the ``config.php`` will be adjusted, which also means enabling |
| 38 | + this feature requires a writable configuration. |
| 39 | + |
| 40 | +Using the web interface |
| 41 | +^^^^^^^^^^^^^^^^^^^^^^^ |
| 42 | + |
| 43 | +The setting is provided in the **Administration settings** under **Basic settings**. |
| 44 | +Within the **Files compatibility** section the Windows compatibility can be enabled. |
| 45 | + |
| 46 | +.. figure:: images/files-windows-compatibility.png |
| 47 | + :alt: Enforce windows compatibility checkbox on the Administration - Basic settings - Files compatibility page. |
| 48 | + |
| 49 | +Using the occ command |
| 50 | +^^^^^^^^^^^^^^^^^^^^^ |
| 51 | + |
| 52 | +.. note:: |
| 53 | + |
| 54 | + This command was introduced in Nextcloud 32. |
| 55 | + |
| 56 | +To quickly enable or disable the feature an :ref:`occ command <occ_files_windows_filenames>` is provided. |
| 57 | + |
| 58 | +Consequences |
| 59 | +------------ |
| 60 | + |
| 61 | +After enabling Windows compatible filenames users cannot create or modify files |
| 62 | +with invalid filenames. But they can still delete or rename those files (to valid names). |
| 63 | + |
| 64 | +This works by setting a pre-defined set of configuration settings: |
| 65 | + |
| 66 | +- ``forbidden_filename_basenames`` will be set to names reserved on Windows. |
| 67 | +- ``forbidden_filename_characters`` will be set to characters not valid for filenames on Windows. |
| 68 | +- ``forbidden_filename_extensions`` will be set to strings not allowed as trailing parts, like a trailing dot or spaces. |
| 69 | + |
| 70 | +Sanitizing invalid filenames |
| 71 | +---------------------------- |
| 72 | + |
| 73 | +After enabling the feature the users have to manually adjust all invalid filenames |
| 74 | +to be able to keep working with them. |
| 75 | +As an alternative Nextcloud provides the :ref:`occ files:sanitize-filenames <occ_files_sanitize_filenames>` command to automatically rename all invalid files. |
0 commit comments