Skip to content

All images put to storage are saved as 'octet-stream' rather than image/jpeg #1570

@Oakyden

Description

@Oakyden

I'm creating a new managed Expo app, on SDK 31.

I have the following function

 uploadImage = async (uri, imageName) => { 

    this.setState({attemptingUpload: true})

    const response = await fetch(uri);
    const blob = await response.blob();

    var ref = firebase.storage().ref().child('images/' + imageName+'.jpg');

    var metadata = { cotentType: 'image/jpeg', };

    return ref.put(blob, metadata);
  }

It uploads the image successfully and with the right file extension (and i've dictated the metadata type to be sure) . However, all the files are uploading as 'application/ octet-stream' which is the firebase default and indeed this appears to make the uploaded file non-readable.

Any ideas for why this is happening? Looking at the firebase sdk sourcecode i'd have thought this would work

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions