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
- Storage files aren’t showing on mobile
hi, what can be the problem? i have a storage and there are images in it, the permissions are read for All Users, everything is fine on desktop, but on mobile t...
- Delete storage files all at once
I am using Appwrite Cloud. I want to delete all storage files in my bucket similar to how I can select all documents in a collection and delete them all at once...
- Storage images are not showing on mobile
Hi, can anyone help me? I have some images on the storage, and it is not shown on mobile, on desktop everything is fine.