GetFileDownload returns a string without Project parameter.
Pastajello opened this issue · 3 comments
Hello.
So Im trying to use some Storage methods in functions.
So Im trying to use GetFileDownload to finish my work on .net sample function for object detection.
From documentation it creates link like this:
/v1/storage/files/{fileId}/download
for link generated by the Storage class:
http://localhost/v1/storage/files/60f85fa05c655/download?
I get a response :
"{"message":"Missing or unknown project ID","code":400,"version":"0.9.1"}"
BUT works for
http://localhost/v1/storage/files/60f85fa05c655/download?project=60f85f2973fd8
🐛 Bug Report
Have you spent some time to check if this issue has been raised before?
Yup.
To Reproduce
Call
var url = Storage.GetFileDownload("id")
Expected behavior
I'd either:
-get downloaded bytes (the OKeiest solution :D )
-get a request with api_key/projectId in headers and parameters(such as quality) as parameters
-get a string with everything as parameter
Actual Behavior
get a string with parameters but without projectID which is necessary to actually access the file we want.
Your Environment
Appwrite 0.9.1
Appwrite sdk for .net 0.2.0
Its quite evedent that the projectId and api_key(not needed maybe sometimes only) are commented out in the method.
https://github.com/appwrite/sdk-for-dotnet/blob/main/io/appwrite/src/Appwrite/Services/Storage.cs#L154
Why? I wonder If the aim was to create a Request containing the projectId in the headers instead of string.
The .NET SDK will receive some love again soon. For now it wasn't a priority and we haven't been able to bring it on par with the other SDK's.
This is fixed in v0.4+