JourneyApps Legacy Docs
Return to JourneyApps Docs
  • UI Components
    • button (v1) (deprecated)
    • button (v2) (deprecated)
    • capture-coordinates (legacy docs)
    • capture-file (legacy docs)
    • capture-signature (legacy docs)
    • display-file (legacy docs)
    • display-signature (legacy docs)
    • info-table (legacy docs)
    • list (legacy docs)
    • menu (deprecated)
    • object-dropdown (legacy docs)
    • object-table (v1) (deprecated)
    • object-table (v2) (deprecated)
    • scan-barcode (legacy docs)
    • single-choice-dropdown (legacy docs)
  • JS/TS APIs
    • dialog (deprecated)
    • confirmDialog (deprecated)
    • generateCSV (deprecated)
    • saveFile (deprecated)
  • Other Features
    • Access Control Rules (deprecated)
    • Global View (app.xml) (deprecated)
    • Linking Views (deprecated)
    • Sync Rules v1 (deprecated)
  • Sync Rules v2 (legacy docs)
    • Migrating to Sync Rules v2
  • Manage App Users (deprecated)
Powered by GitBook
On this page
  • Format
  • Examples
  1. JS/TS APIs

saveFile (deprecated)

PreviousgenerateCSV (deprecated)NextAccess Control Rules (deprecated)

Last updated 2 years ago

saveFile() is considered deprecated

Support for the saveFile() may be dropped in future versions of the JourneyApps Runtime. Please upgrade your app to use to ensure that your app remains compatible with the JourneyApps Runtime.

Version and platform compatibility

saveFile was introduced in version 4.25.0 of the JourneyApps Container.

Due to limitations on mobile file systems, this method only works on Desktop platforms.

Format

saveFile(data, filename);
Parameter
Details

data (Required)

The string or ArrayBuffer to save to the file

filename (Required)

The name of the file that will be created

Examples

Saving a string:

var text = "Text to save!";
saveFile(text, 'my-file.txt');

Saving an image:

var buffer = view.myImage.toArrayBuffer();
saveFile(buffer, 'my-image.jpg');
journey.files.saveFile