Skip to content

Commit

Permalink
Change: fix pinata
Browse files Browse the repository at this point in the history
  • Loading branch information
Voktor Stolenets committed Jan 6, 2025
1 parent 7ac022b commit faa5803
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,10 @@ async function uploadFile(request: FastifyRequest, reply: FastifyReply) {
const writeStream = fs.createWriteStream(filePath);
data.file.pipe(writeStream);

const fileStream = fs.createReadStream(filePath);
const formData = new FormData();
formData.append(data.filename, fs.createReadStream(filePath));
formData.append("file", fileStream, path.basename(filePath));

const response = await axios.post(PINATA_ENDPOINT, formData, {
headers: {
...formData.getHeaders(),
Expand Down

0 comments on commit faa5803

Please sign in to comment.