\n\n
\n

post joke

\n
\n \n \n \n
\n
\n```\n\n**backend: +page.server.ts**\n\n```\nimport { ID, Databases, Client, Storage } from 'appwrite';\nimport { Buffer } from 'buffer';\nimport { InputFile } from 'node-appwrite/file';\nexport const actions = {\n post: async ({ request }) => {\n const data = await request.formData();\n const image = data.get('image');\n\n const arrayBuffer = await image.arrayBuffer();\n const buffer = Buffer.from(arrayBuffer);\n\n const client = new Client()\n .setEndpoint('https://cloud.appwrite.io/v1') // API Endpoint\n .setProject('xxx'); // project ID\n\n const storage = new Storage(client);\n\n const result = await storage.createFile(\n 'xxx', // bucketId\n ID.unique(),\n InputFile.fromBuffer(buffer, 'sssss')\n );\n\n console.log(result);\n }\n};\n\n```\n\ni read the docs it says that i should use the InputFile when the image is processed on a backend, i made the bucket any with everything checked\n\nthanks in advance.","author":{"@type":"Person","name":"mina99"},"datePublished":"2025-03-31T17:39:13.263Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/LikeAction","userInteractionCount":0}}}
Skip to content
Back
WebStorage

source.on is not a function

Votes

0

Replies

0

Participants

Unknown

Messages

1

mina99Original post

Web Developer

Join the discussion

Reply to this thread by joining our Discord.

Reply on Discord