menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Building a...
source image

Dev

3w

read

266

img
dot

Image Credit: Dev

Building a File Upload App with TypeScript, React, and Auto-Drive API

  • A simple app for uploading files to a Distributed Storage Network (DSN) using Autonomy's Auto-Drive API leveraging RadzionKit repository has been created.
  • The app will consist of a single page with an API key entry and file management views.
  • API key is stored with the AutoDriveApiKeyGuard component which will allow to validate the API key dynamically.
  • Local storage is used to store API key.
  • The UploadFile component handles the upload process showing spinner while the file is being uploaded and displays an error message if the upload fails.
  • Uploading files is straightforward with the Auto-Drive SDK.
  • PaginatedView and useInfiniteQuery are used to handle pagination for querying the API.
  • UseCurrentFileProvider is used to provide the current file to its children.
  • The ManageFile component displays the file name or CID and includes buttons for downloading and deleting the file.
  • Deleting a file calls the Auto-Drive SDK’s markObjectAsDeleted function with the file’s CID, and we invalidate the list of files to refresh.

Read Full Article

like

16 Likes

For uninterrupted reading, download the app