The Telerik Platform product is retired.Learn more

Introduction to Offline Files

Introduction to Offline Files

Storing files in Telerik Platform differs from storing other data in that it is split in two parts: storing the file metadata and storing the file content. All standard Backend Services JavaScript SDK file metadata operations are supported in offline mode—creating, reading, updating, and deleting files. However, managing the file content offline requires additional operations.

The preferred method for making files available offline is through HTML tag processing. See these articles to learn how to implement it:

For cases unsupported by HTML processing, use the low-level offline file API:

In both cases, you can offline-enable files stored in Telerik Platform as well as external files from third-party providers.

This article is organized as follows:

Where Offline Files are Stored

As described in Initializing Offline Mode, when initializing the Everlive instance you can optionally specify where your offline files go.

Offline files always use the file system provider because of their large expected size, but you can specify the file paths as follows:

  • offline.files.storagePath—Specifies where file content is stored. Default value: el_file_store/
  • offline.files.metaPath—Specifies where file mapping data is stored. Default value: el_file_mapping/

For Hybrid apps ensure that the Cordova File plug-in is enabled.

File Synchronization

All file operations are synchronized to the cloud whenever synchronization is invoked, similarly to other data operations. It is worth noting that file content is also synchronized, which may take significant time to complete.

If you use the Custom conflict resolution strategy, you are limited to using either the server item or the client item. You cannot use a custom item.

See Data Synchronization in Offline Mode for details.

Offline Files Encryption

As mentioned in Data Security in Offline Support, offline files are not encrypted with the rest of the content type data.

If file encryption is important for your app, advise your users to enable the device's built-in file system encryption (if any).

Limitations and Considerations

Have these in mind when working with file offline:

  • Offline Support for files is currently available only in Cordova and Node.js applications. NativeScript is not supported.
  • Offline files are always stored on the file system, even if another provider is selected for content types using the constructor option.
  • The operations of downloading and synchronizing a file may take a long time, depending on the size of the file. It is recommended to download offline only files that are really needed.
  • Because offline files require the fileSystem storage provider you cannot test the feature on web apps and web-based device simulators. The AppBuilder desktop device simulators support the FileSystem storage provider.

See Also

Contact us: +1-888-365-2779
Copyright © 2016-2018, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.