Allow firebaseStorageDownloadTokens to be set as a SettableMetadata #7339
Unanswered
jbryanh
asked this question in
Feature request
Replies: 1 comment
-
Refer to my answer here: #7340 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not sure if this is a bug or should remain a simple feature request. Because of the error I received, I think putting this as a feature request is appropriate. There is a dearth of documentation on this functionality.
When I set the following code:
final metadata = firebase_storage.SettableMetadata( customMetadata: {'firebaseStorageDownloadTokens': customToken});
_uploadTask = _storage.ref().child(filePath).putFile(widget.file!, metadata);
I get the following error:
E/StorageException( 6906): Caused by: java.io.IOException: { "error": { "code": 400, "message": "Not allowed to set custom metadata for firebaseStorageDownloadTokens" }}
So, the enhancement request is either:
(incidentally, I have to run on Android to get an error, iOS gives no error, as documented here:
Extended errors below:
E/StorageException( 6906): StorageException has occurred.
E/StorageException( 6906): An unknown error occurred, please check the HTTP result code and inner exception for server response.
E/StorageException( 6906): Code: -13000 HttpResult: 400
E/StorageException( 6906): The server has terminated the upload session
E/StorageException( 6906): java.io.IOException: The server has terminated the upload session
E/StorageException( 6906): at com.google.firebase.storage.UploadTask.serverStateValid(UploadTask.java:339)
E/StorageException( 6906): at com.google.firebase.storage.UploadTask.shouldContinue(UploadTask.java:308)
E/StorageException( 6906): at com.google.firebase.storage.UploadTask.run(UploadTask.java:232)
E/StorageException( 6906): at com.google.firebase.storage.StorageTask.lambda$getRunnable$7$StorageTask(StorageTask.java:1072)
E/StorageException( 6906): at com.google.firebase.storage.-$$Lambda$StorageTask$_IQT0HwL0SAn4-mUxblkILcDlBo.run(Unknown Source:2)
E/StorageException( 6906): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/StorageException( 6906): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/StorageException( 6906): at java.lang.Thread.run(Thread.java:923)
E/StorageException( 6906): Caused by: java.io.IOException: { "error": { "code": 400, "message": "Not allowed to set custom metadata for firebaseStorageDownloadTokens" }}
E/StorageException( 6906): at com.google.firebase.storage.network.NetworkRequest.parseResponse(NetworkRequest.java:445)
E/StorageException( 6906): at com.google.firebase.storage.network.NetworkRequest.parseErrorResponse(NetworkRequest.java:462)
E/StorageException( 6906): at com.google.firebase.storage.network.NetworkRequest.processResponseStream(NetworkRequest.java:453)
E/StorageException( 6906): at com.google.firebase.storage.network.NetworkRequest.performRequest(NetworkRequest.java:272)
E/StorageException( 6906): at com.google.firebase.storage.network.NetworkRequest.performRequest(NetworkRequest.java:289)
E/StorageException( 6906): at com.google.firebase.storage.UploadTask.send(UploadTask.java:469)
E/StorageException( 6906): at com.google.firebase.storage.UploadTask.uploadChunk(UploadTask.java:428)
E/StorageException( 6906): at com.google.firebase.storage.UploadTask.run(UploadTask.java:231)
E/StorageException( 6906): ... 5 more
Beta Was this translation helpful? Give feedback.
All reactions