Skip to content

Commit 86d59ef

Browse files
committed
fix: upload files without a wrapper directory.
- remove .png in the filename
1 parent f47f13f commit 86d59ef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async function main() {
8888
for (let attemptIPFS = 1; attemptIPFS <= 5; attemptIPFS++) {
8989
try {
9090
ipfsResponse = await ipfsPublish(
91-
`${token.symbol}.png`,
91+
`${token.symbol}`,
9292
resizedImageBuffer,
9393
)
9494
console.info(` Done.`)

src/utils/ipfs-publish.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async function ipfsPublish(
1616
): Promise<{ hash: string; path: string }[]> { // Return an array of objects with a hash property
1717
const buffer = Buffer.from(data);
1818

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

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

0 commit comments

Comments
 (0)