I am creating a web app, in which I receive a image file from the user then have to store it in my Firebase Realtime Database and display it in Html. Since Realtime Database doesn't support files I have to create a Url for my image.
The Url I want is not a download link like this which I got from the Firebase Cloud Storage Url creation tool, rather I need a viewable link like this which I can add to the src on my tag in Html like this:
<img src="The Url">
I have tried using Firebase Cloud Storage, but when uploading and image file, the image is uploaded as an Application/octate-stream rather than an image. When I run the geturl() function it gives me this link which leads to a download page and therefore I cannot it to the src attribute of tag.
The file uploading code is this:
var file_from_usr = document.getElementById('file_input')
var storageRef = firebase.storage().ref();
var thisRef = storageRef.child(filename);
thisRef.put(file_from_usr).then((snapshot) => {
console.log('Uploaded a blob or file!');
});