I want to read file which i have added in my cloud function what is the path in cloud so I can access it
if (request.path == "/read_proto") {
// Define the path to your .proto file
String filePath = '${io.Directory.current.path}/protos/test.proto';
try {
// Read the file as text
String content = io.File(filePath).readAsStringSync();
return response.json({
'path': request.path,
'proto': content,
});
} catch (e) {
return response.json({
'path': request.path,
'error': e.toString(),
});
}
}
"error": "PathNotFoundException: Cannot open file, path = '/usr/local/server/protos/test.proto' (OS Error: No such file or directory, errno = 2)"
I have dart function in following structure
dart_func
- lib/
- protos/
Cannot open file, path = '/usr/local/server/protos/test.proto
You won't be able to do this with go because your code is compiled and only the compiled binary is deployed
I show below function which is mention in templates
https://github.com/appwrite/templates/blob/main/dart/whatsapp_with_vonage/lib/utils.dart
I tried this way and got this error
"error": "PathNotFoundException: Cannot open file, path = '/usr/local/server/src/function/../protos/test.proto' (OS Error: No such file or directory, errno = 2)"
final protosFolder =
p.join(p.dirname(io.Platform.script.toFilePath()), '../protos');
final protosFilePath = p.join(protosFolder, "test.proto");
// Read the file as text
String content = io.File(protosFilePath).readAsStringSync();
Sorry I don't think that works
with go?
Sorry same with dart. Dart is also compiled
Okay, Thank you for your time.
I have one question, if I upload file in storage is there any way I can make it publically so I don't need to authenticate for file
https://cloud.appwrite.io/v1/storage/buckets/67cb873900041825c482/files/67cb877300353e5b4122/view?project=67ae34c00007ef221886&mode=admin
Sure. Configure the permissions for the bucket and possibly file
Yeah, I just figured it out. Thanks
For function, will it have support in future for read/add temp file when we deploy function?
Recommended threads
- Documentation That's Not Useful
Collections show me this link to explain what the activity tab is for. https://appwrite.io/docs/products/databases/databases the documentation honestly is not h...
- Console cloud is down
As attached I can not login to console and it affected to our services that uses Appwrite <#1102936099745177700> <#564160731327758347>
- Failed sending to target <Email> with er...
Hi! I got this problem and trying to test the resend smtp server. But when I use messaging feature within the console it says. ```Failed sending to target <Ema...