I'm sorry if I did something wrong when I try to upload a file with InputFile.fromPath, but I can't figure what.
I'm on node v.18 and node-appwrite v.13
var sdk = require('node-appwrite');
var fs = require('fs');
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject('<projectID>')
.setSession('');
const storage = new sdk.Storage(client);
storage.createFile(
'<bucketID>',
'unique()',
sdk.InputFile.fromPath('out.png', 'out.png'),
["read('any')"]
);
```
My image is on the same level than my index.js.
... sdk.InputFile.fromPath('out.png', 'out.png'), ^ TypeError: Cannot read properties of undefined (reading 'fromPath')
Many thanks for your help.
Recommended threads
- Error getting preview of file
Rest Response: ``` { "message": "Server Error", "code": 500, "type": "general_unknown", "version": "1.8.1" } ``` Appwrite Logs ``` appwrite ...
- Storage images using custom domain retur...
Some of the images uploaded to my storage bucket returns this error: ``` { "message": "Project with the requested ID could not be found. Please check the value...
- Bandwidth limit for your organization ha...
I received an alert that I exceeded the Free plan bandwidth limit (showing 5.86 GB), but my dashboard tells a different story. The usage stats there are much lo...