Skip to content

File Operations

The file command group allows you to upload, pin, and manage files on IPFS through the Aleph Cloud network.

Overall Usage

bash
aleph file [OPTIONS] KEY_COMMAND [ARGS]...

Options

CommandDescription
--helpShow the help prompt and exit

Key Commands

CommandDescription
uploadUpload a file to IPFS via Aleph Cloud
pinPin an existing IPFS file on Aleph Cloud
statusCheck the status of a file
forgetRemove a file from Aleph Cloud pinning
listList all files for a given address

Uploading Files

Usage

bash
aleph file upload [OPTIONS] PATH

Arguments

ArgumentTypeDescription
PATHPATHPath of the file to upload

Options

OptionsTypeDescription
--channelTEXTAleph Cloud network channel where the message is or will be broadcasted [default: ALEPH-CLOUDSOLUTIONS]
--private-keyTEXTYour private key. Cannot be used with --private-key-file
--private-key-filePATHPath to your private key file [default: /home/$USER/.aleph-im/private-keys/ethereum.key]
--refTEXTItem hash of the message to update
--debug / --no-debug[default: no-debug]
--helpShow this message and exit

Upload / Update local files to IPFS through Aleph Cloud:

bash
# Upload a single file
aleph file upload /path/to/file.txt

# Upload with a specific channel
aleph file upload /path/to/file.txt --channel ALEPH-MAIN

# Update a file from its item hash
aleph file upload --ref ITEM_HASH /path/to/file.txt

Pinning Existing Files

If you already have content on IPFS, you can pin it on Aleph Cloud:

Usage

aleph file pin [OPTIONS] ITEM_HASH

Arguments

ArgumentTypeDescription
ITEM_HASHITEM_HASHIPFS hash to pin on Aleph Cloud

Options

OptionsTypeDescription
--channelTEXTAleph Cloud network channel where the message is or will be broadcasted [default: ALEPH-CLOUDSOLUTIONS]
--private-keyTEXTYour private key. Cannot be used with --private-key-file
--private-key-filePATHPath to your private key file [default: /home/$USER/.aleph-im/private-keys/ethereum.key]
--refTEXTItem hash of the message to update
--debug / --no-debug[default: no-debug]
--helpShow this message and exit

Pin files on IPFS

bash
# Pin by IPFS hash
aleph file pin ITEM_HASH

Downloading Files from Aleph Network

Download a file from Aleph Cloud or display its information:

Usage

aleph file download [OPTIONS] ITEM_HASH

Arguments

ArgumentTypeDescription
ITEM_HASHITEM_HASHhash to download from Aleph Cloud

Options

OptionsTypeDescription
--use-ipfs / --no-use-ipfsDownload using IPFS instead of storage [default: no-use-ipfs]
--output-pathPATHOutput directory path [default: .]
--file-nameTEXTOutput file name (without extension)
--file-extensionTEXTOutput file extension
--only-info / --no-only-info[default: no-only-info]
--verbose / --no-verbose[default: verbose]
--debug / --no-debug[default: no-debug]
--helpShow this message and exit
bash
# Download a file from its ITEM_HASH
aleph file download ITEM_HASH

# Download a file from its ITEM_HASH and renaming it as new_name
aleph file download ITEM_HASH --file-name new_name

# Download a file from its ITEM_HASH as a python program named new_name
aleph file download ITEM_HASH --file-name new_name --file-extension .py

Forgetting Files

Forget a file and his message on Aleph Cloud:

Usage

aleph file forget [OPTIONS] ITEM_HASH(ES) [REASON]

Arguments

ArgumentTypeDescription
ITEM_HASH(ES)ITEM_HASHHash(es) to forget. Must be a comma separated list. Example: 123...abc or 123...abc,456...xyz
REASONTEXTReason to forget [default: User deletion]

Options

OptionsTypeDescription
--channelTEXTAleph Cloud network channel where the message is or will be broadcasted [default: ALEPH-CLOUDSOLUTIONS]
--private-keyTEXTYour private key. Cannot be used with --private-key-file
--private-key-filePATHPath to your private key file [default: /home/$USER/.aleph-im/private-keys/ethereum.key]
--debug / --no-debug[default: no-debug]
--helpShow this message and exit
bash
# Forget a file by hash
aleph file forget ITEM_HASH

# Forget with a reason
aleph file forget ITEM_HASH --reason "File no longer needed"

Listing Files

List all files for a given address:

Usage

bash
aleph file list [OPTIONS]

Options

OptionsTypeDescription
--addressTEXTAddress you are interested in
--private-keyTEXTYour private key. Cannot be used with --private-key-file
--private-key-filePATHPath to your private key file [default: /home/$USER/.aleph-im/private-keys/ethereum.key]
--paginationINTEGERMaximum number of files to return. [default: 100]
--pageINTEGEROffset in pages. [default: 1]
--sort-orderINTEGEROrder in which files should be listed: -1 means most recent messages first, 1 means older messages first. [default: -1]
--json / --no-jsonPrint as json instead of rich table [default: no-json]
--helpShow this message and exit
bash
# List your own uploaded files
aleph file list

# List files uploaded by a specific address
aleph file list --address ADDRESS

# List your own files from oldest to newest (ascending order)
aleph file list --sort-order 1

# List the 50 oldest files uploaded by a specific address
aleph file list --address ADDRESS --sort-order 1 --pagination 50

Troubleshooting

Common issues and solutions:

  • File upload fails: Check your network connection and file permissions
  • Pin operation times out: The IPFS network might be congested, try again later
  • File not found: Verify the hash is correct and the file exists on IPFS
  • Permission errors: Ensure you're using the correct account with proper permissions