firebase-tools
firebase-tools copied to clipboard
Uploading a .png image with .putData() creates an octet-stream object instead of a png object in storage emulator
[REQUIRED] Environment info
firebase-tools: 11.9.0
Platform: Windows 10
[REQUIRED] Steps to reproduce
- Create an app that has access to the emulator.
- Convert a png image to bytes
- Upload the data with
.putData(data, SettableMetadata(contentType: 'image/png'));
- Check the result in storage emulator
[REQUIRED] Expected behavior
As in version 11.7.0, I expected to have a image/png object added to the storage emulator.
[REQUIRED] Actual behavior
Instead it adds a application/octet-stream.
This issue does not seem to follow the issue template. Make sure you provide all the required information.
what sdk are you using?
I use the flutter SDK https://github.com/firebase/flutterfire/tree/master/packages/firebase_storage
I have a similar issue with 11.8.1
when using uploadBytesResumable
with Node client. Only happens with PNGs.
Error is:
error FirebaseError: Firebase Storage: An unknown error occurred, please check the error payload for server response. (storage/unknown)
When checking the type, it says application/octet-stream
I also have a similar issue with any file that is larger than ~200kB:
FirebaseError: Firebase Storage: An unknown error occurred, please check the error payload for server response. (storage/unknown)
The type is always application/octet-stream
and the size is always 262.14 kB
We have the same issue when we do upload() via firebase admin to the storage emulator, since updating from 11.9.0 to 11.16.0
I've been having a similar issue as well in the emulator: when adding a file to the emulator through firebase admin's upload() the type is always application/octet-stream.
Hi, I think the discussion here has been for two separate issues.
- Some of you are having issues with resumable uploads erroring out and also having the type
application/octet-stream
(@sebschre, @balazss, and maybe @Wizzel1). I think this was reported before (https://github.com/firebase/firebase-tools/issues/4959) and fixed in this pr (https://github.com/firebase/firebase-tools/pull/5018). Try updating to the latest firebase-tools release and your issue should hopefully be fixed, if not please report back and we can take a closer look! - There is another issue that I was able to reproduce where some admin sdks are not setting the file type properly, its always being set to
application/octet-stream
. The fix for this is a WIP.
@LanderBeeuwsaert and @rulamon I think you are running into this second issue. Which admin sdk are you using?
Hi @Yuangwang, I'm running 11.2.0
@LanderBeeuwsaert Sorry I think I was a bit unclear, which one of these from https://firebase.google.com/docs/admin/setup#prerequisites are you using?
@Yuangwang ah apologies, the Node.js SDK, package firebase-admin, 11.2.0
Thanks! this will help in debugging
Merged in fix for admin sdk issue https://github.com/firebase/firebase-tools/pull/5229 it should be out with the new release. I also followed the steps to reproduce the original bug and it seems to be fixed so I'm closing this for now.