Search code examples
androidfirebasegoogle-cloud-platformgoogle-cloud-storagefirebase-storage

How to download gp3 file from firebase Storage?


I am giving service of uploading gp3 and download them. I want to know how can I download them(I am using at Android Studio). Here's the upload To storage code:

private void uploadSelectedAudio(){
    final ProgressDialog progressDialog = ProgressDialog.show(soundSelectBasic.this, "upload..", "Connecting", true);
    FirebaseStorage storage = FirebaseStorage.getInstance();
    String    uniqueId=mCurrentUser.getUid();
    StorageReference filePath = storage.getReferenceFromUrl("gs://my-project-2a397.appspot.com/audio/profile/UserID/" + uniqueId + ".3gp");
    Uri uri = Uri.fromFile(new File(mFileName));
   // Toast.makeText(soundSelectBasic.this,mFileName.toString(),Toast.LENGTH_LONG).show();
    filePath.putFile(uri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
        @Override
        public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
            progressDialog.dismiss();
         finish();
        }
    });

`


Solution

  • If I understood your question correctly, I would suggest you have a look at the Firebase documentation https://firebase.google.com/docs/storage/android/download-files