Skip to content

13XLabs File Sharing Storj is the simplest way to send your files around the world. Share large files. 13XLabs File Sharing Storj is a simple, easy-to-use tool for sharing files directly from your device without having to rely on third-party intermediaries like big corporate cloud providers.

Notifications You must be signed in to change notification settings

13X-Labs/File-Sharing-Storj

Repository files navigation

About File Sharing

File Sharing by 13X Labs is the simplest way to send your files around the world.
This is Demo Project.

Features

  • Share and receive files using IPFS.
  • Upload or drag-and-drop individual files or entire directories
  • Preview files in-browser (browser-supported formats only) before sharing or downloading
  • Generates a QR code for share links for easy distribution
  • 100% mobile-friendly

Initial Set-up (Important)

Install node-gyp globally

$ npm install -g node-gyp

Install the storj-nodejs Node.js package

$ npm install uplink-nodejs

Set Environment variable:

  • MacOS:
    • Set DYLD_LIBRARY_PATH environment variable
      • Run following command inside root directory of your project
        export  DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/node_modules/uplink-nodejs/
        
      OR
      • Copy libuplinkc*.* files from $PROJECTROOT/node_modules/uplink-nodejs/ to /usr/local/lib

  • Windows:
    • Set Path environment variable to libuplinkc*.* which is $PROJECTROOT/node_modules/uplink-nodejs
For NodeJS
  • Please ensure Node.js with version 10 or higher is installed
    • Check Node.js version
      $ node -v
      
  • please ensure make is already installed.
  • please ensure node-gyp dependencies is already installed.
  • please ensure @types/node dependencies is installed for running module in typescript.

Run development

First, run the development server:

npm run dev

Upload Files

Upload any files to IPFS (Demo server storj-ipfs.com)

uploadImage = (e) => { 
    let url = 'https://demo.storj-ipfs.com/api/v0/add'
    if (e.target.files && e.target.files[0]) {
      let file = e.target.files[0];

      let formData = new FormData();
      formData.append("file", file);
      axios.post(url, formData, {
        headers: {
          'Content-Type': `multipart/form-data; boundary= ${file._boundary}`,
        },
        maxContentLength: Infinity,
        maxBodyLength: Infinity,
        onUploadProgress: (progressEvent) => {
          const { loaded, total } = progressEvent;
          let precentage = Math.floor((loaded * 100) / total);
          console.log("options");
          console.log(precentage);
          if (precentage <= 100) {
            this.setState({
              precentageUpload: precentage
            })
          }
        }
      }).then((response) => {
        console.log(response)
        this.setState({
          urlImage: response.data.Hash
        })
      }).catch((error) => {
        console.error(error)
      });
    }
  }

About

13XLabs File Sharing Storj is the simplest way to send your files around the world. Share large files. 13XLabs File Sharing Storj is a simple, easy-to-use tool for sharing files directly from your device without having to rely on third-party intermediaries like big corporate cloud providers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published