Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

loading binary content? #5

Open
gnunicorn opened this issue May 25, 2016 · 0 comments
Open

loading binary content? #5

gnunicorn opened this issue May 25, 2016 · 0 comments

Comments

@gnunicorn
Copy link

I am trying to sync a bunch of files from browserFS via the safenet library onto safenet but I get some problems with that in the browser and I am not sure, what is going wrong.

If I use the BrowserFS's fs.readFileSync() (which mimics the node js FS-module), it gives me a Buffer-Object, but passing that to safenet's nfs.updateFile doesn't work (it saves a json-to-string). While using fs.readFileSync(filename, 'utf8') appears to give me the string I can pass to updateFile, that fails on binary data (like PNG-files). Do you have any example of uploading a binary file via the safenet API? How are you doing it with buffers?

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

1 participant