Eueno
  • EUENO – Decentralized Encrypting Blockchain Oracles for Web3
    • Litepaper
    • Use Cases
  • Get Started
    • Prerequisites
    • Buckets
      • Create a bucket
      • Delete a bucket
    • Files
      • Upload a file
      • View a file
      • Delete a file
      • Share a file
  • Pricing
  • Eueno libraries
    • @eueno/lib-browser
      • Installation
      • Setup
      • Create key (generate a key for encrypting the file(s))
      • login()
      • useEuenoContext()
      • getUserInfo()
      • updateUserInfo()
      • createProject()
      • getProjectInfo()
      • getProjects()
      • getFilesListByFolder()
      • deleteProject()
      • createFolder()
      • uploadFolder()
      • Get folder detail
      • deleteFolder()
      • uploadFile()
      • uploadFileWithSignedUrl()
      • getCid()
      • getFileById()
      • getFileListById()
      • Get file detail
        • getDetailFile()
        • getDetailUnencryptedFile()
        • getDetailEncryptedFile()
      • getDetailMultiEncryptedFiles()
      • deleteFile()
      • shareFile()
      • shareMultiFile()
      • deleteSharePermission()
      • getShareList()
      • getShareListToMe ()
    • @eueno/lib-node
      • Create eueno client
      • Create project key
      • Create project
      • Upload file
      • Upload folder
      • Get file
      • Get list file
      • Share file
      • Get shared files
      • Create folder
      • Create Account
      • Decrypt Get Key Aes
      • Decrypt File by Key Aes
  • Policies
    • Privacy Policy
    • Terms of Service
Powered by GitBook
On this page
  • Syntax
  • Parameters
  • Example
  1. Eueno libraries
  2. @eueno/lib-browser

uploadFileWithSignedUrl()

Syntax

uploadFileWithSignedUrl(file: File, options: UploadFileWithSignedUrlOptions)

The method used to upload files in Eueno. We have two types to upload: encrypted and unencrypted.

Parameters

Name
Type
Required
Description

file

File

Yes

File upload

options

UploadFileWithSignedUrlOptions

Yes

Type UploadFileOptions has the structure like this:

interface UploadFileWithSignedUrlOptions {
  uploadUrl: string;
  uploadTorrentUrl: string;
  exportedKey?: string; //Require if encrypt
}

Example

import {UploadFileWithSignedUrlOptions} from "@eueno/lib-browser";

const uploadFile = async () => {
   const file = files[0];
   const uploadUrl = "https://upload-service.eueno.io/upload?signature=eyJhbGciOiJSUzI1Ni..."
   const uploadTorrentUrl: "https://upload-service.eueno.io/upload?signature=eyJhbGciOiJSUzI1NiIsInR..."
   const exportedKey = "4R2Bw-kz9DnWA5FEcoopIsPhZZ5PswLBvtPwll6ejkU"
   const options = {
      uploadUrl,
      uploadTorrentUrl,
      exportedKey   
   }
   
   const response = await uploadFileWithSignedUrl(file, options);
    
    console.log(response);
 };

Response of example:

{
    data: {
        Hash: "QmQL923LcmRn6wSxgN7Yr6w2M2xBz8r4tpPxaatq3S45Z3",
        Name: "puz.png",
        Size: "51625",
    }
    status: 200
}

PreviousuploadFile()NextgetCid()

Last updated 1 year ago