Push File

Push files to storage or IPFS.

Returns

The functions return the file_hash for the pushed file.

function_push_file pushes the file to someplace that will be garbage collected. Use .create_store() to create a STORE Message for it.

Arguments

  • file_content is required.

  • session is optional and defaults to None.

  • api_server is optional and defaults to aleph https://api2.aleph.im.

To Storage

def storage_push_file(
    file_content,
    session,
    api_server
)

To IPFS

If you've already stored a file in an IPFS storage, you can still create a file using the .create_store() to "pin" it, by passing the: { ..., storage_engine: "ipfs" , file_hash: <ipfs item hash> , ... }

def ipfs_push_file(
    file_content,
    session,
    api_server
)

Last updated