Upload File
Last updated
Last updated
const form = new FormData();
form.append('file', fs.createReadStream('path/to/your/file.pdf'));
const response = await fetch('https://api.getfractal.xyz/v0/files', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
},
body: form
});
const data = await response.json();
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"type": "text"
}