Skip to main content

Remove JSON Extensions

It is necessary to remove the .json file extensions of your JSON files before using them with your collection's contract baseURI.

Scatter contracts work by adding your baseURI with the ID of a token to know how to look up that token's metadata. This is why you cannot have .json file extensions on your JSON files.

For example: ipfs://JSONCID/ + 1 = ipfs://JSONCID/1 and not ipfs://JSONCID/1.json

File Extensions Can Be Hidden...

If your OS is set to hide file extensions you may not know that they are there. A quick test would be to upload 1 JSON file somewhere and see if the .json file extension is there.

Don't manually rename JSON files! Human error is common even for a small number of files, better to use the options below.

Windows

Press Windows Key + R together to open the run prompt.

Type cmd and press enter to open the command prompt.

Type cd followed by a space in the command prompt and then drag the folder where your JSON files are in into the command prompt window and then press enter.

Copy and paste the following command into the command prompt and press enter.

for %i in (*.json) do ren "%i" "%~ni"

All JSON files in the current folder should have their .json file extensions removed.

macOS

Press Command + Space Bar on your Mac keyboard (alternatively, press F4) Type in “Terminal” When you see Terminal in the Spotlight search list, click it to open the app.

Type cd followed by a space in Terminal. Then drag the folder where your JSON files are in into the Terminal window and press enter.

Copy and paste the following command into the Terminal window and press enter.

for file in *.json; do mv "$file" "${file%.json}"; done

All JSON files in the current folder should have their .json file extensions removed.

Linux

Press Ctrl + Alt + T to open Terminal on Linux.

Type cd followed by a space in Terminal. Then drag the folder where your JSON files are in into the Terminal window and press enter.

Copy and paste the following command into the Terminal window and press enter.

for file in *.json; do mv "$file" "${file%.json}"; done

All JSON files in the current folder should have their .json file extensions removed.