Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Data Reading is not correct #1287

Closed
moda20 opened this issue Mar 29, 2018 · 4 comments
Closed

Data Reading is not correct #1287

moda20 opened this issue Mar 29, 2018 · 4 comments

Comments

@moda20
Copy link

moda20 commented Mar 29, 2018

  • Version: 0.27.7
  • Platform: Zen ArchLinux
  • Subsystem:

Type: Bug

Severity: High

Description:

Data returned by Ipfs.object.data() is not the same as the one got from the Read-Only gateway

Steps to reproduce the error:

run jsipfs daemon
create a node from the existing ports localIpfs
call localIpfs.files.add(Buffer.from("TEXT")) returns Hash
call localIpfs.object.data(Hash)returns something like []*^TEXT ( is the same text but with ascii characters before it and maybe somewhere in the middle)
It is bad if i am transferring base64 image data.

@richardschneider
Copy link
Contributor

ipfs.object.data(Hash) returns the data portion of the Merkle DAG which is not the same as file's data.

Use ipfs.cat(Hash) to get the data of the file.

@moda20
Copy link
Author

moda20 commented Mar 30, 2018

I see, If it is an image in what format i will be getting it ? base64 ?

@richardschneider
Copy link
Contributor

IPFS does not care about the format of the data, it is returned via ipfs.cat exactly as it was passed to ipfs.add.

@moda20
Copy link
Author

moda20 commented Apr 2, 2018

Thank you, it worked. I am closing this then.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants