aurelg/ipfs-wormhole

Preserve file name in `transfer.sh` mode (unencrypted content downloaded from an IPFS gateway)

Opened this issue · 0 comments

When no encryption is requested, the content shared with ipfs-wormhole can be retrieved from its IPFS hash and an IPFS gateway (ala transfer.sh). However, such a downloaded file would be named according to its IPFS hash. This is not very convenient.

A solution could be to put the content to send into a temporary directory, which is itself added to IPFS recursively with ipfs add -r. The HTTP link to the gateway could then contain both the IPFS hash of the directory and the real file name to the to allow for a proper naming of the downloaded file.

Two comments about the implementation:

  • A temporary directory cannot be piped into ipfs add as it is the case with the current implementation
  • If the content to send is a file, creating a hardlink in the temporary directory would be fine. If the content to send is a directory, it would first have to be compressed and stored into the temporary directory before the latter is added to IPFS. This requires some additional disk space.