
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
- :rotating_light: CORS Error After Deploy...
Hi team, I'm facing an issue after deploying my React app to production. Issue: When trying to upload a file to Appwrite storage from the production domain `...
- NullReferenceException whenever I call s...
I hope you’re doing well. I’m encountering a NullReferenceException: Object reference not set to an instance of an object. whenever I call storage.CreateFile(.....
- Image Loading issue in Snapgram project
Hello community, I have a issue with the Image Loading I made a Project from youtube of Snapgram, it worked perfectly 8 months ago, but now the images aren't l...
