
The docs point towards using one of the sdk methods InputFile.fromPath(), InputFile.fromBuffer() etc...
in case you're on the server side.
But I want to upload directly a File object, I tried this but obviously it's not working because File is not an assignable parameter given the InputFile method.
const FILE = formData.get('dataModel');
if (FILE instanceof File) {
const promise = storage.createFile(BUCKET_ID, FILE_ID, FILE);
The file I am dealing with is a File object likes this one:
File {
size: 75621,
type: 'application/json',
name: 'xquad-ca_predictions.json',
lastModified: 1707319609241
}
Docs source: https://appwrite.io/docs/products/storage/upload-download#server-sdks
Recommended threads
- Can't download a file through the AppWri...
Heya! SO I am learning backend using Node.js. I am using AppWrite for storage, and in the application I want the files to be downloaded, which are stored by the...
- Looking for Guidance: GraphQL + Relation...
Hey everyone! š I'm building a project using Next.js and exploring different backend options. I want to set up a proper backend with GraphQL and support for tw...
- The current user is not authorized to pe...
Hello, I am attempting to receive fetch data from databases.listDocuments with each of its env parameter data for it to be shown on a NextJS project. However I ...
