Push Files

Call the .PushFileToStorageEngine() to push file to storage or IPFS.

Returns

The function returns the file_hash for the stored file or null if the file could not be stored.

import { PushFileToStorageEngine } from "aleph-sdk-ts/messages/create/publish"
import { StorageEngine } from "aleph-sdk-ts/messages/message"

(async() => {
  await PushFileToStorageEngine({
    file: file, 
    APIServer: api_url,
    storageEngine: StorageEngine.STORAGE
  })
})()

Required parameters

ParameterDescription

file - File or Blob or string

File to push to storage or ipfs

APIServer - string

Target API server

storageEngine - StorageEngine

Storage engine to use, either Aleph storage or IPFS.

Possible values: StorageEngine.STORAGE or StorageEngine.IPFS

Last updated