0

Anyone have tried to Upload mp3 files through Firebase. I have the following(simplified):

ref.push({

                titel: jQuery("#" + this._gnf.titel).val(),

                submitted_by: {
                    name: jQuery("#" + this._gnf.submitted_by[0]).val(),

                },

                  song: jQuery("#" + this._gnf._song).val(),

            });// END: ref push

The "song" ref should hold the mp3 files. Have been reading that you have to convert them to a base64 string. But can it even be done with an MP3 file? The

jQuery("#" + this._gnf._song).val();

refer to at input file:

<input id="file-upload" name="file-upload" type="file" class="file" multiple=true data-preview-file-type="any">
  • Firebase is a JSON database. Since MP3 files are not a JSON type, you will have to convert it to a supported type yourself. Using base64 you can encode any binary format to/from a string. See http://stackoverflow.com/questions/13955813/how-can-i-view-and-store-images-in-firebase for more information. – Frank van Puffelen Apr 04 '16 at 14:46
  • Thank a Lot. Will look into that – user3414539 Apr 04 '16 at 15:01

0 Answers0