Open fahadh4ilyas opened 2 years ago
@fahadh4ilyas I can do it by use a File
object, when I use javascript. So I think python can use the same way.
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)
}
}
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