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 ^^

Thx!

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.

2 Likes

Perfect, that does the trick!

ipfs add -w

Thank you!