File and Folder Issues

            

Do you have an error code?


 If not, use the following list of problems on this page to read about possible causes and resolutions. 


Problem

 Folders downloaded as ZIP (> 4GB) do not open properly in Windows. When a folder or multiple files are downloaded from web UI, they will be downloaded as a zip archive. If the total size of the zip files is greater than 4 GB, then the zip will be malformed.

Cause

This is a PHP on Windows limitation.

Resolution

Limit the total size of the zip folder to be less than 4 GB

Problem

Folders downloaded as ZIP (> 4GB) do not open properly in LINUX. When a folder or multiple files are downloaded from web UI, they will be downloaded as a zip archive. If the total size of the zip files is greater than 4 GB, then the zip will be malformed.

Cause

This is a known issue with PHP.

Resolution

To support ZIP files larger than 4 GB:

1. Open the configuration file:

WWWROOT/config/cloudconfig.php

2. Add the following line:

define("TONIDOCLOUD_ZIP_IMPL",  "ZIP64" );

(lightbulb) This workaround only resolves the issue on Linux. Switching to this ZIP implementation on Windows does not allow support of zip archives larger than 4 GB.

Problem

File names with the following characters won't upload using web browser.

  • Left bracket [
  • Right bracket ]

Cause

This is a known issue with PHP.

Resolution

Use one of the following recommendations:

  • Rename the file and upload
  • Upload file using FileCloud Sync

Problem

This issue applies only to:

  • Existing network folders which are mapped through FileCloud and not managed storage
  • FileCloud running on a Windows Server

When you are opening a file or uploading a file to your FileCloud folder, you might get an error that the file path is too long or you may be unable to upload the file.

For example:

  • If you try to open the file directly from a folder (FileCloud Sync folder or FileCloud drive folder) using Acrobat reader or another application, you will see an error message telling you that path is too long.
  • You cannot copy or drag and drop a file to the path (FileCloud Sync folder or FileCloud drive folder) if the file path exceeds 260 characters. You may still be able to upload the file directly using the FileCloud user portal and it is syncing properly.

Sample Error Message:

The file path is too long. Please specify a shorter file name or save to a location that has a shorter path.


Cause

There is a known limitation in Windows (version) that path lengths cannot exceed 260 characters long.

For more information, read the Microsoft Windows documentation on:
 Naming Files, Paths, and Namespaces

Resolution

To fix this problem you need to edit a registry key.

This solution only works if you are running FileCloud on Windows Server 2016.

There are no known resolutions for running FileCloud on any other version of Widows Server 2016.

 

You may still be able to upload the file directly using the FileCloud user portal. This will also sync the file properly.

If you want to correct the issue occurring when:

  • opening a file in a folder with a path that exceeds 260 characters via the web browser
  • using drag and drop to upload files into a folder via a web browser that has a path that exceeds 260 characters 

Then you need to edit the Windows server registry.  The FileSystem value has the LongPathsEnabled  variable set to 0  by default. To correct this issue you must change it to 1.

This resolution of editing a registry key has been tested and works for the following FileCloud access mode:

FileCloud User Web Portal

This resolution has not been fully tested for the following FileCloud editions:

FileCloud Sync

FileCloud Drive


To edit the registry:

  1. On the Windows taskbar, in the search box , type regedit.
  2. Select the top result, regedit Run command.  
  3. If you see a message asking if you want to allow this application to make changes to your device, click Yes.
  4. In Registry Editor, navigate to the following path:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

    5.  On LongPathsEnabled, right-click and then select Modify.

    6.  In the Edit DWORD Value window, in Value Data, replace the 0 with 1.

    7. To save your changes, click OK.

    8.  Restart the server.

Figure 1. Navigating in Registry Editor

Problem

The multiple ways Unicode uses to represent a visually indistinguishable glyph using different but equivalent representations can cause many sorts of unexpected behaviors.

These behaviors are normally seen in the following situations:

  • Working on files between Windows and Mac
  • Files that have unicode strings

For example, if a given file in FileCloud is stored in NFC form and edited and re-uploaded from Mac OSX, that file gets uploaded as NFD, leading to two visually indistinguishable files being stored by FileCloud in a single folder.

 


Cause

There are some special considerations when working with Unicode strings. Unicode can have multiple ways to represent a visually indistinguishable glyph using different but equivalent representation for example there are many different Unicode forms (NFC, NFD, NFKD, NFKC) to represent Unicode strings.

Refer to WikiPedia for more detailed information. 

This can cause non-trivial and complex issues when working with File System Objects (like files and folders) in FileCloud across filesystems.

Operating SystemStandard NormalizationDetails
WindowsNFC [1] but others workWindows can work with all 4 forms Unicode normalization and therefore can have four different versions of same visually similar file name â?.txt in a single folder
Mac OSXNFD (closest form)Mac OSX represents all files/folders in NFD form. Only a single file can exist with a given unicode string (irrespective of normalization)

 


Resolution


Starting with FileCloud 12.0, there are some functional changes that help handle this situation.

  • FileCloud will use NFC as the preferred form to store file names and folder names, however, it will never be a case where there will be 100% NFC form used for all files. The reason is that many different clients can behave differently  when they upload data into FileCloud. For example: WebDAV clients and other third party can still push NFD normalized strings.
  • FileCloud will disallow creation of two filenames or folders with visually indistinguishable glyphs in the same path or location


Normalization Handling

ClientNormalization FormAutomatic ConversionNotes
Web BrowserUploads any FormFile names and Folder Names automatically converted to NFC.
Can be disabled using a config option. 

Sync AppUploads only NFC format.None

(From 12.0)
On Windows, non-NFC files from server are downloaded but ignored. New non-NFC format files are ignored and are not synced.
On Mac OSX, non-NFC files from server will download but ignored.

Drive AppUploads any FormNone
iOS Image UploadsUploads NFD FormNone
iOS SyncUploads only NFC formatNone
AndroidUploads any FormNone
Outlook & Office Add-On (from 12.0)Uploads only NFC formatNone


Configuring Options to Control Normalization Form Handling Behavior

(warning) Any kind of Normalization behavior on the server requires the php_intl extension to be installed and active on your server. Upgrading to the latest 12.0 release components will provide the "intl" extension and this can be checked in the Admin->Checks page.



To control whether any automatic conversion to NFC is done or not:

  1. Navigate to the WWWROOT\config folder.
  2. Open the cloudconflig.php file.
  3. Add the following line:

define("TONIDO_DISABLE_UTF8NORMALIZATION", 1);

4. Save the changes.

5. Restart the server.

Converting Existing Files or Folder Names to NFC

You can obtain a script from Technical support called:

  • normalization.php

This script can convert existing files or folder names to NFC normalization form.

To run the conversion script:

  1. Save the script file normalization.php in the following folder:

WWWROOT/resources/backup folder

2. To use the PATH variable, which refers to FileCloud paths, look for a line similar to /USERNAME. This is the place where all files and folders are used for a specific username. (e.g. /john)

To check a specific path
c:\xampp\php\php.exe normalization.php -p PATH
 
To fix the issues in a specific path
c:\xampp\php\php.exe normalization.php -p PATH -f 1
 
An optional hostname can be provided for multi-tenant solutions
c:\xampp\php\php.exe normalization.php -p PATH -h HOSTNAME

Problem

All current versions of files in a user account become unusable.

Cause

In some situations, a user may face data loss due to:

  • file corruptions
  • encryption by ransomware attacks

Resolution 

In these cases, it is possible to run a script to export previous versions of all files.

Enable PHP CLI Mode

To run the following commands, PHP CLI mode needs to be enabled.

In LINUX:

  1. Edit the file /etc/php5/cli/php.ini and make sure the module mongo.so is enabled. Without this the reset password command will fail.
  2. To enable mongo.so, add the following line at the end of file /etc/php5/cli/php.ini (if this line doesn't exist in the file)

extension=mongo.so

In Windows:

  1. The PHP cli mode is already enabled in the FileCloud Installer.

Download the Tool

To download the Update Settings tool:

  1. In a web browser, navigate to the following url: http://patch.codelathe.com/tonidocloud/live/scripts/fc/prevversionexporter.zip
  2. Download the update settings tool zip.
  3. Unzip the contents of the download zip file onto the folder WWWROOT/resources/backup
    Where WWWROOT is

    WindowsC:\xampp\htdocs\
    Linux/var/www or /var/www/html depending on the Linux distro
  4. The zip contains one script file:

    prevversionexporter.phpTool to be used for exporting previous versions of all user files

Table 1. Tool Options

-uname of the user account whose files are to be exported
-ddestination path where the files are to be stored
-hsite url for which files are to be exported
-rflag to export files. Without this flag, only a simulation will be done
-pspecify a particular managed storage path to export
-aflag to export "All Previous Versions". Without this flag only the latest of the available previous versions will be exported

Run the Tool in Linux

From a Linux command shell, type the following commands. 

In the above command:

Reovering Previous versions in Linux
To recover "only one previous version":
user@li111-150:~$ cd /var/www/resources/backup
user@li111-150:/var/www/resources/backup$ php ./prevversionexporter.php -u tester -d /tmp/export -r



To recover "all previous versions":
user@li111-150:~$ cd /var/www/resources/backup
user@li111-150:/var/www/resources/backup$ php ./prevversionexporter.php -u tester -d /tmp/export -a -r

-u : User account for which previous file versions are to be exported <Required>
-d : Directory to which the files are to be exported <Required>
-h : Host name for which export needs to be performed (needed in case of multisite installations) <Optional>
-r: Use the flag to actually export the files. Running without this flag only will simulate the export. <Optional>

Run the Tool in Windows

In a windows command shell, type the following commands.

Recovering Previous versions in Windows
To recover "only one previous version":
C:\WINDOWS\system32>cd c:\xampp\htdocs\resources\backup
c:\xampp\htdocs\resources\backup>c:\xampp\php\php.exe prevversionexporter.php -u tester -d c:\export -r



To recover "all previous versions":
C:\WINDOWS\system32>cd c:\xampp\htdocs\resources\backup
c:\xampp\htdocs\resources\backup>c:\xampp\php\php.exe prevversionexporter.php -u tester -d c:\export -a -r

Problem

Sometimes, Upload fails with message "Storage Error"

Cause

This is caused because the Storage path that is set in the admin portal doesn't have Web (www-data) Permissions  

Resolution

Change the permission of the Storage Path (eg. . /opt/fileclouddata)

Use the following command to change the permission of the storage path

chown -R www-data directory/filename