I

IPFS DROPBOX AND FILE-HASH GENERATOR.

It allows you to submit files from your computer and generates a hash for it. It also returns the filename and description you added so as to access the file later even if the file is deleted.

Created on 17th April 2021

I

IPFS DROPBOX AND FILE-HASH GENERATOR.

It allows you to submit files from your computer and generates a hash for it. It also returns the filename and description you added so as to access the file later even if the file is deleted.

The problem IPFS DROPBOX AND FILE-HASH GENERATOR. solves

  1. It generates a hash for every type of file which can be stored instead of storing the file itself.
  2. It makes sharing files very simple as you can just share the hash and others can access the file using the hash instead of you spending your internet .Apps like whatsapp have data upload limit of 16mb but you can share the hash of even very big files even via whatsapp(as you can text them the hash) and others can still access the files through the file hash.
  3. In apps like dropbox and google drive you can access your files only through these apps but using the file hash you can access the file directly without any intermediaries.Also you have to create an account and then verify it and only then you can use these apps, but once you have the file hash you dont need to access any kind of intermediary neither login with any account but can directly access the file itself.

NOTE : the file should be accessed in the format https://ipfs.infura.io/ipfs/fileHash on any browser. and dont share it in this format as it will then become a clickable link(unless you want to share it as a clickable link).

Challenges I ran into

  1. The "addFile" was to be made "async" and "ipfs.add()" was to be awaited for :
    I didnt do so and everytime I selected a file the previous file buffer was assigned to it it hence file hashes were randomly allocated to any file.This bug took me almost 3-4hours.Then I realised that I had to make the function async and await for the ipfs.add() to complete and only then update the state variable "fileLink" and then add it to items :[] hence creating a new item.
  2. Buffer was not updated :
    I was not updating the buffer after a new file was selected which led to generation of a single hash for every file which pointed to the very first file.
  3. Did not use "infura" was instead using "ipfs daemon" :
    I was running ipfs locally with the help of ipfs daemon but the issue is that every person who wants to generate a hash on my website needs have ipfs on their computer. So I searched and found out that I could use the infura public gateway in my "fileLink" state variable.

Discussion

Builders also viewed

See more projects on Devfolio