File not supported on Windows only

Hi all,

Current situation:

ipfs add image1.jpg

This works well as expected.

ipfs get Qm....

On Ubuntu, i get my file as expected, and the image opens without issues.
However, on Windows, i get ‘this file is not supported’ error.

I’ve tried with piping into a jpg, jpeg, png, everything, but the problem remains.

Google did not provide me with any assistance, i hope you guys (and girls) can ^^


What’s the exact error you’re seeing and where are you seeing it (a screenshot of the Windows console would be helpful).

There is no error. It fetches the file without any issue.

Here’s a screenshot of the output, together with the files on Windows Explorer

If i manually append the Qm… file with *.jpg, the image renders as it should.

As reminder, i don’t have this issue on Ubuntu running in VM.
If i wrap the images in a folder, and retrieve the folder, i don’t have this issue neither.

If it fetches the file without any issue I don’t understand what’s the problem.? Are you trying to say that your original file is corrupted after adding it and then getting it back from IPFS ?

Unless you add the file with the -w flag to “wrap” the file in a directory, ipfs will forget the filename on add. So, when you call ipfs get Qm...., IPFS will use the Qm.... as the filename. Unfortunately, Windows relies on file extensions to pick the right handler for the file. As Qm... doesn’t specify an extension, Windows has no idea how to handle this situation.

Try adding the file with ipfs add -w image1.jpg. When you fetch the corresponding hash with ipfs get, you’ll get a directory (folder) containing a file named image1.jpg.


Perfect, that does the trick!

ipfs add -w

Thank you!