Back

File Extension Not Allowed

  • 0
  • Cloud
grindorliveaverage
12 Oct, 2024, 19:01

I have no permissions yet am seeing this error in an attempt to create a .tar file my array buffer of an image in my storage using this ```js const result = await storage.getFileView('SID', 'FID'); const buffer = Buffer.from(result); const pack = tar.pack(); pack.entry({ name: IMG_0930.png }, buffer, () => { pack.finalize(); });

TypeScript
const chunks = [];
pack.on('data', (chunk) => chunks.push(chunk));
pack.on('end', async () => {
  const tarBuffer = Buffer.concat(chunks);

  const filename = 'images.tar'; 
  const uploadedFile = await storage.createFile(
      config.storageId, 
      ID.unique(), 
      InputFile.fromBuffer(tarBuffer, filename) 
  );

});``` would appreciate the help pls

TL;DR
Issue with file extension validation in storage settings causing errors. Developer removed the extension and it worked, but wonders if permissions glitch reverted settings. Code provided shows attempt to create .tar file resulting in error despite no permissions issues. Solution: Check and adjust file extension settings for the bucket.
Steven
12 Oct, 2024, 19:04

What did you set for the file extensions for the bucket?

grindorliveaverage
12 Oct, 2024, 19:14

i just removed it rn and it worked again but i'm pretty sure i hade done this before. is there a glitch at times when you update your. permission settings they will revert to the previous permissions?

Steven
12 Oct, 2024, 19:16

File extension validation isn't permissions, but no I haven't heard of updates not persisting

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more