Skip to main content
Version: 3.0.1

Upload (W3UP Bridge)

Upload (W3UP Bridge) Function

IPFS Upload (W3UP Bridge) Uploads a local file or directory to the IPFS network using the web3.storage W3UP Bridge. This function requires inputs as follows:

  • Path 1 : Local path to the file or directory to upload.
  • DID 2 : The DID used in authorization obtained from Web3.Storage.
  • AuthSecret 3 : The authorization secret. Can be generated using w3 cli as 'X-Auth-Secret'.
  • AuthToken 4 : The authorization token. Actually a JWT-encoded UCAN. Can be generated using w3 cli as 'Authorization'.
info

AuthSecret and AuthToken are generated using w3-cli. This command generates them as X-Auth-Secret and Authorization respectively: w3 bridge generate-tokens <DID>. More information available in the official documentation.

There's also an optional input Request Name 5, a unique identifier for the plugin's HTTP subsystem. It allows to fetch the request by name. This is purely optional and only changes how the HTTP request will be managed internally by the plugin.

IPFS Upload (W3UP Bridge)

info

If Success is True that only means the upload to the IPFS network was successful.

If successful returns outputs as follows:

  • Request 6 : Handle to a HTTP request, allows for cancellation of an ongoing request.
  • Bytes Sent 7 : Number of bytes sent while the request is still ongoing.
  • Request Size 8 : Total size of the request.
  • Response 9 : Struct, holds data such as headers, status code, and body of the response of the HTTP request.
  • IPFS Address 10 : The CID of the uploaded data and path to the file if applicable.