In this tutorial you will learn how to use Arcana Storage SDK and upload a file to the distributed Arcana Store.

Prerequisites​

• Make sure your dApp is integrated with Arcana Storage SDK.
• All prerequisites for integrating with Storage SDK must be met
• The code in the steps section refers to StorageProvider object initialized during Storage SDK integration:
import { StorageProvider } from '@arcana/storage/dist/standalone/storage.umd';dAppStorageProvider = new StorageProvider({        appId: ARCANA_APP_ID,        provider: window.ethereum,        email: user_email_string,});

Steps​

At a high level, uploading the file is a two step process that involves obtaining an Uploader from the Storage SDK and calling the upload function with the specified file. Make sure you save the DID assigned to the uploaded file for future use. You will require it to perform any file access modification operation or to delete the file.

const Uploader = dAppStorageProvider.getUploader();

// file: Blob formatUploader.upload(file);