Skip to main content

Delete a file from Arcana Store

In this tutorial you will learn how to enable file deletion functionality in your dApp. Each file uploaded in the Arcana Store is identified by its unique DID. This DID is assigned at the time of file upload operation.

Prerequisites

  • Make sure your dApp is integrated with Arcana Storage SDK
  • The code in the next section refer to StorageProvider and Access objects 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,
});

const Access = new dAppStorageProvider.getAccess();

Delete a file

//Specify the correct DID that corresponds to the file you uploaded via dApp to Arcana Store
Access.deleteFile(did);

What's Next?

You can verify that the file you deleted does not exist anymore on the Arcana Store by obtaining storage metrics and listing all the files that the user uploaded.

See also