We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any way to add bytes or JSON data without saving it to a temporary file before adding it to IPFS? I wanna do something like
sample_dict = { "some_key": "some_value" } client.add_json(sample_dict, filename="some_data.json")
Instead, I have to do this
sample_dict = { "some_key": "some_value" } with open('some_data.json', 'w') as f: json.dump(sample_dict, f) client.add('some_data.json')
The text was updated successfully, but these errors were encountered:
@fahadh4ilyas I can do it by use a File object, when I use javascript. So I think python can use the same way.
File
async function onChange(e) { var json = `{ "a": 1 }`; var file = new File([json], 'test.json', { type: 'application/json' }); try { const added = await client.add(file) const url = `https://ipfs.infura.io/ipfs/${added.path}` updateFileUrl(url) } catch (error) { console.log('Error uploading file: ', error) } }
Sorry, something went wrong.
No branches or pull requests
Is there any way to add bytes or JSON data without saving it to a temporary file before adding it to IPFS? I wanna do something like
Instead, I have to do this
The text was updated successfully, but these errors were encountered: