Scandit.Fs

Methods

(static) writeTempFile(name: string, content: string, options?: object): Promise

Writes temporary file

Parameters:
Name Type Attributes Description
name string

File name with extension, for example testfile.txt

content string

The data that should be written to the file (if options.binary is true this should be an integer array).

options object <optional>

Camera configuration

Properties
Name Type Attributes Default Description
binary string <optional>
false

Whether the content should be treated as an integer array.

Returns:
Promise

Promise which is resolved with the local file url

Can return an error with code:

Examples
  • JavaScript
  • ES6
Scandit.Fs.writeTempFile('temporaryFile.txt', 'the content of the temporary file')
  .then(function(filePath) {
    console.log('New temporary file at path: ' + filePath);
  })
  .catch(function(reason) {
    console.log('There was an error while writing ' + filePath + ': ' + reason);
  });
Scandit.Fs.writeTempFile('temporaryFile.txt', 'the content of the temporary file')
  .then(filePath => {
    console.log(`New temporary file at path: ${filePath}`);
  })
  .catch(reason => {
    console.log(`There was an error while writing ${filePath}: ${reason}`);
  });