Store file extension

Hi there!

I’ve been trying to store docx and pdf files on the IPFS network.
My question is that is there any way to store the extension of the uploaded file? Or how should I know what is the type (pdf or docx) of the downloaded file?

Thank you for your help!

You can do a couple things:

You can construct a URL that points to the file and contains the filename:

https://dweb.link/ipfs/QmQkEiBf6sq1yP97MXn3afJhdifBnhmV9s8k5strvVdNEr?filename=yoko.jp2

Or, you can wrap the file (ipfs add -w) and construct a URL with the path to the file:

https://dweb.link/ipfs/QmV1tu9EoSSYRvfBX7PUj7m3LPNqgFT1hUz2ji1GvtH4Yc/yoko.jp2

2 Likes

I am not that expert, but I saw on the documentation that there should be a meta object somewhere, and I read they were encouraging developers to use that particular field for additional informations. Maybe I got it wrong…

You can also use MFS (Mutable File System)

1 Like