Skip to content

Commit

Permalink
fix: upload files without a wrapper directory.
Browse files Browse the repository at this point in the history
- remove .png in the filename
  • Loading branch information
salgozino committed Jun 5, 2024
1 parent f47f13f commit 86d59ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function main() {
for (let attemptIPFS = 1; attemptIPFS <= 5; attemptIPFS++) {
try {
ipfsResponse = await ipfsPublish(
`${token.symbol}.png`,
`${token.symbol}`,
resizedImageBuffer,
)
console.info(` Done.`)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ipfs-publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function ipfsPublish(
): Promise<{ hash: string; path: string }[]> { // Return an array of objects with a hash property
const buffer = Buffer.from(data);

const cid = await filebase.storeDirectory([new File([buffer], fileName)]);
const cid = await filebase.storeBlob(new File([buffer], fileName), fileName);

return [{ hash: cid, path: `${cid}/${fileName}` }]; // Return an array
}
Expand Down

0 comments on commit 86d59ef

Please sign in to comment.