How to add file to IPFS with filename?


Im trying to add file to IPFS. Im using:
curl -X POST -F file=@myfile

but the result field “name” is equal with the hash of the file. What should i do to have to file name in the name field instead of the hash?


Meanwhile I found the problem: using - is in filenames is not a good idea…

1 Like

Hi @macracanta12, and welcome to the Infura community! Thanks for posting your solution so others in the community can reference it :slight_smile:

Hi @macracanta12 The name field for the result is typed to be a string.
This is the hash of the public key that can direct to users to the file.
It cannot be changed.
You can read more about it here

Hi, thanks yor the reply

1 Like