Back

storage.updateFile() doesn't take in inputFile as a parameter

  • 0
  • Storage
FUZZY
28 May, 2024, 05:44

I am genuinely confused about how to update an existing file, since storage.updateFile() doesn't take in the file object, there seems no way to overwrite an existing file other than deleteFile and then createFile again. I am working on node.js btw, this is the official node.js sdk declaration updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File>

TL;DR
Problem: The developer is struggling to update an existing file using storage.updateFile() in a node.js environment because it doesn't accept the inputFile as a parameter. They are considering deleting the file and creating a new one as a workaround. Solution: The developer can use the provided updateFile method by passing the bucketId, fileId, name (if needed), and permissions as parameters to update the existing file.
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