firebase storage getting downloadURL problemIntent problem, return value (Android)Get screen dimensions in pixelsjava.lang.NullPointerException for static field in Android library projectsetText on button from another activity androidAdding Social Media Share Logic From Firebase in AndroidActivity can still call unbind service method. Is it normal?java.lang.NullPointerException when invoking onLoadFinished()Search Firestore query don't show data in RecycleViewAndroid: Multiple image viewHow to add child(Product) under a child(Store) in Firebase Database using RecyclerView

How valuable is a categorical feature that has a predominant category over all other ones?

How did the European Union reach the figure of 3% as a maximum allowed deficit?

Does knowing the surface area of all faces uniquely determine a tetrahedron?

Co-worker is now managing my team. Does this mean that I'm being demoted?

Why was New Asgard established at this place?

Are there any individual aliens that have gained superpowers in the Marvel universe?

How can I prevent a user from copying files on another hard drive?

Are there examples of rowers who also fought?

How to write a nice frame challenge?

Why do you need to heat the pan before heating the olive oil?

I have found ports on my Samsung smart tv running a display service. What can I do with it?

I'm yearning in grey

How "fast" do astronomical events occur?

...and then she held the gun

How did Frodo know where the Bree village was?

What is this airplane that sits in front of Barringer High School in Newark, NJ?

What does this Swiss black on yellow rectangular traffic sign with a symbol looking like a dart mean?

SQL Server has encountered occurences of I/O requests taking longer than 15 seconds

Basic power tool set for Home repair and simple projects

In a Fish that is not a Fish

Does anyone recognize these rockets, and their location?

Is a sequel allowed to start before the end of the first book?

What is the precise meaning of "подсел на мак"?

Print the new site header



firebase storage getting downloadURL problem


Intent problem, return value (Android)Get screen dimensions in pixelsjava.lang.NullPointerException for static field in Android library projectsetText on button from another activity androidAdding Social Media Share Logic From Firebase in AndroidActivity can still call unbind service method. Is it normal?java.lang.NullPointerException when invoking onLoadFinished()Search Firestore query don't show data in RecycleViewAndroid: Multiple image viewHow to add child(Product) under a child(Store) in Firebase Database using RecyclerView






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















when i tried to get the download URL for my image in firebase storage I got something weird i got this result




com.google.android.gms.tasks.zzu@3a6d712




and here is my code



public class MainActivity extends AppCompatActivity 

private StorageReference mStorage;
private ProgressDialog mProgressDialog;
private static final int GALLERY_REQUEST_CODE = 1;
private static final int CAMERA_REQUEST_CODE = 2;
private Button uploadButton;
private Button captureButton;
ImageView imageViewBig, imageViewSmall;

@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

mStorage = FirebaseStorage.getInstance().getReference();
mProgressDialog = new ProgressDialog(this);
imageViewBig = findViewById(R.id.imageViewBig);
imageViewSmall = findViewById(R.id.imageViewSmall);
captureButton = findViewById(R.id.captureButton);
uploadButton = findViewById(R.id.uploadButton);
captureButton.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, GALLERY_REQUEST_CODE);

);


@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GALLERY_REQUEST_CODE && resultCode == RESULT_OK)
Uri uri = data.getData();
StorageReference filePath = mStorage.child("photos").child(uri.getLastPathSegment());
filePath.putFile(uri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(final UploadTask.TaskSnapshot taskSnapshot)
Toast.makeText(MainActivity.this, "DONE", Toast.LENGTH_SHORT).show();
imageViewBig.setBackgroundColor(Color.GREEN);
imageViewBig.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Log.i("URL", taskSnapshot.getMetadata().getReference().getDownloadUrl().toString());

);

);





so how to get the right download URL to download the image into image view using picasso










share|improve this question
























  • format & compress code

    – pirho
    Mar 25 at 6:45

















1















when i tried to get the download URL for my image in firebase storage I got something weird i got this result




com.google.android.gms.tasks.zzu@3a6d712




and here is my code



public class MainActivity extends AppCompatActivity 

private StorageReference mStorage;
private ProgressDialog mProgressDialog;
private static final int GALLERY_REQUEST_CODE = 1;
private static final int CAMERA_REQUEST_CODE = 2;
private Button uploadButton;
private Button captureButton;
ImageView imageViewBig, imageViewSmall;

@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

mStorage = FirebaseStorage.getInstance().getReference();
mProgressDialog = new ProgressDialog(this);
imageViewBig = findViewById(R.id.imageViewBig);
imageViewSmall = findViewById(R.id.imageViewSmall);
captureButton = findViewById(R.id.captureButton);
uploadButton = findViewById(R.id.uploadButton);
captureButton.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, GALLERY_REQUEST_CODE);

);


@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GALLERY_REQUEST_CODE && resultCode == RESULT_OK)
Uri uri = data.getData();
StorageReference filePath = mStorage.child("photos").child(uri.getLastPathSegment());
filePath.putFile(uri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(final UploadTask.TaskSnapshot taskSnapshot)
Toast.makeText(MainActivity.this, "DONE", Toast.LENGTH_SHORT).show();
imageViewBig.setBackgroundColor(Color.GREEN);
imageViewBig.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Log.i("URL", taskSnapshot.getMetadata().getReference().getDownloadUrl().toString());

);

);





so how to get the right download URL to download the image into image view using picasso










share|improve this question
























  • format & compress code

    – pirho
    Mar 25 at 6:45













1












1








1








when i tried to get the download URL for my image in firebase storage I got something weird i got this result




com.google.android.gms.tasks.zzu@3a6d712




and here is my code



public class MainActivity extends AppCompatActivity 

private StorageReference mStorage;
private ProgressDialog mProgressDialog;
private static final int GALLERY_REQUEST_CODE = 1;
private static final int CAMERA_REQUEST_CODE = 2;
private Button uploadButton;
private Button captureButton;
ImageView imageViewBig, imageViewSmall;

@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

mStorage = FirebaseStorage.getInstance().getReference();
mProgressDialog = new ProgressDialog(this);
imageViewBig = findViewById(R.id.imageViewBig);
imageViewSmall = findViewById(R.id.imageViewSmall);
captureButton = findViewById(R.id.captureButton);
uploadButton = findViewById(R.id.uploadButton);
captureButton.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, GALLERY_REQUEST_CODE);

);


@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GALLERY_REQUEST_CODE && resultCode == RESULT_OK)
Uri uri = data.getData();
StorageReference filePath = mStorage.child("photos").child(uri.getLastPathSegment());
filePath.putFile(uri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(final UploadTask.TaskSnapshot taskSnapshot)
Toast.makeText(MainActivity.this, "DONE", Toast.LENGTH_SHORT).show();
imageViewBig.setBackgroundColor(Color.GREEN);
imageViewBig.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Log.i("URL", taskSnapshot.getMetadata().getReference().getDownloadUrl().toString());

);

);





so how to get the right download URL to download the image into image view using picasso










share|improve this question
















when i tried to get the download URL for my image in firebase storage I got something weird i got this result




com.google.android.gms.tasks.zzu@3a6d712




and here is my code



public class MainActivity extends AppCompatActivity 

private StorageReference mStorage;
private ProgressDialog mProgressDialog;
private static final int GALLERY_REQUEST_CODE = 1;
private static final int CAMERA_REQUEST_CODE = 2;
private Button uploadButton;
private Button captureButton;
ImageView imageViewBig, imageViewSmall;

@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

mStorage = FirebaseStorage.getInstance().getReference();
mProgressDialog = new ProgressDialog(this);
imageViewBig = findViewById(R.id.imageViewBig);
imageViewSmall = findViewById(R.id.imageViewSmall);
captureButton = findViewById(R.id.captureButton);
uploadButton = findViewById(R.id.uploadButton);
captureButton.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, GALLERY_REQUEST_CODE);

);


@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GALLERY_REQUEST_CODE && resultCode == RESULT_OK)
Uri uri = data.getData();
StorageReference filePath = mStorage.child("photos").child(uri.getLastPathSegment());
filePath.putFile(uri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(final UploadTask.TaskSnapshot taskSnapshot)
Toast.makeText(MainActivity.this, "DONE", Toast.LENGTH_SHORT).show();
imageViewBig.setBackgroundColor(Color.GREEN);
imageViewBig.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Log.i("URL", taskSnapshot.getMetadata().getReference().getDownloadUrl().toString());

);

);





so how to get the right download URL to download the image into image view using picasso







android






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 6:45









pirho

5,299122132




5,299122132










asked Mar 25 at 5:11









ANDROID_BIGGENERANDROID_BIGGENER

82




82












  • format & compress code

    – pirho
    Mar 25 at 6:45

















  • format & compress code

    – pirho
    Mar 25 at 6:45
















format & compress code

– pirho
Mar 25 at 6:45





format & compress code

– pirho
Mar 25 at 6:45












3 Answers
3






active

oldest

votes


















0














UploadTask



public class UploadTask extends StorageTask<UploadTask.TaskSnapshot>


An controllable task that uploads and fires events for success, progress and failure. It also allows pause and resume to control the upload operation.



Example



final StorageReference firebaseStorage = FirebaseStorage.getInstance().getReference();

StorageReference postPhotos = firebaseStorage.child("photos/");

final StorageReference upload_Image = postPhotos.child(uri.getLastPathSegment());

//uri = uri of your file which you want to update
UploadTask uploadTask = upload_Image.putFile(uri);
uploadTask.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception e)


);
uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
upload_Image.getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>()
@Override
public void onComplete(@NonNull Task<Uri> task)
if (task.isSuccessful())
//downloadable uri
Uri path = task.getResult();


);

);





share|improve this answer

























  • where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));

    – ANDROID_BIGGENER
    Mar 25 at 11:40












  • @ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes to upload_Image.putFile(uri);

    – Ashvin solanki
    Mar 25 at 11:50












  • @ANDROID_BIGGENER let me see if its not work....

    – Ashvin solanki
    Mar 25 at 11:52











  • thanks very much dear it worked 😘

    – ANDROID_BIGGENER
    Mar 25 at 12:10











  • @ANDROID_BIGGENER glad to help you mark as accepted if its work

    – Ashvin solanki
    Mar 25 at 12:12


















0














Use this Code to upload File on firebase and get download url for that file



Uri file = Uri.fromFile(new File(aadhaarPath));
final StorageReference riversRef = storageRef.child("documents/" + file.getLastPathSegment());
uploadTask = riversRef.putFile(file);

uploadTask.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception exception)
progressDialog.dismiss();

).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)

// get the image Url of the file uploaded
riversRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>()
@Override
public void onSuccess(Uri uri)
Uri downloadUrl = uri;
aadharDownloadUrl = downloadUrl.toString();
uploadPanCard(panCardPath);

);

);


aadhaarPath is file path that you selected to upload



and add this in your build .gradle



implementation 'com.google.firebase:firebase-storage:16.0.3'





share|improve this answer






























    0














    I save photos to Firebase storage and the image name to Firebase realtime database and than i am using Glide to load images from Firebase Storage:



     FirebaseStorage storage = FirebaseStorage.getInstance();
    StorageReference storageRef = storage.getReference();
    StorageReference imageRef = storageRef.child(PHOTO_NAME);

    GlideApp.with(mContext).load(islandRef).into(viewHolder.image);





    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55331560%2ffirebase-storage-getting-downloadurl-problem%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      UploadTask



      public class UploadTask extends StorageTask<UploadTask.TaskSnapshot>


      An controllable task that uploads and fires events for success, progress and failure. It also allows pause and resume to control the upload operation.



      Example



      final StorageReference firebaseStorage = FirebaseStorage.getInstance().getReference();

      StorageReference postPhotos = firebaseStorage.child("photos/");

      final StorageReference upload_Image = postPhotos.child(uri.getLastPathSegment());

      //uri = uri of your file which you want to update
      UploadTask uploadTask = upload_Image.putFile(uri);
      uploadTask.addOnFailureListener(new OnFailureListener()
      @Override
      public void onFailure(@NonNull Exception e)


      );
      uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
      @Override
      public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
      upload_Image.getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>()
      @Override
      public void onComplete(@NonNull Task<Uri> task)
      if (task.isSuccessful())
      //downloadable uri
      Uri path = task.getResult();


      );

      );





      share|improve this answer

























      • where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));

        – ANDROID_BIGGENER
        Mar 25 at 11:40












      • @ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes to upload_Image.putFile(uri);

        – Ashvin solanki
        Mar 25 at 11:50












      • @ANDROID_BIGGENER let me see if its not work....

        – Ashvin solanki
        Mar 25 at 11:52











      • thanks very much dear it worked 😘

        – ANDROID_BIGGENER
        Mar 25 at 12:10











      • @ANDROID_BIGGENER glad to help you mark as accepted if its work

        – Ashvin solanki
        Mar 25 at 12:12















      0














      UploadTask



      public class UploadTask extends StorageTask<UploadTask.TaskSnapshot>


      An controllable task that uploads and fires events for success, progress and failure. It also allows pause and resume to control the upload operation.



      Example



      final StorageReference firebaseStorage = FirebaseStorage.getInstance().getReference();

      StorageReference postPhotos = firebaseStorage.child("photos/");

      final StorageReference upload_Image = postPhotos.child(uri.getLastPathSegment());

      //uri = uri of your file which you want to update
      UploadTask uploadTask = upload_Image.putFile(uri);
      uploadTask.addOnFailureListener(new OnFailureListener()
      @Override
      public void onFailure(@NonNull Exception e)


      );
      uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
      @Override
      public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
      upload_Image.getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>()
      @Override
      public void onComplete(@NonNull Task<Uri> task)
      if (task.isSuccessful())
      //downloadable uri
      Uri path = task.getResult();


      );

      );





      share|improve this answer

























      • where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));

        – ANDROID_BIGGENER
        Mar 25 at 11:40












      • @ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes to upload_Image.putFile(uri);

        – Ashvin solanki
        Mar 25 at 11:50












      • @ANDROID_BIGGENER let me see if its not work....

        – Ashvin solanki
        Mar 25 at 11:52











      • thanks very much dear it worked 😘

        – ANDROID_BIGGENER
        Mar 25 at 12:10











      • @ANDROID_BIGGENER glad to help you mark as accepted if its work

        – Ashvin solanki
        Mar 25 at 12:12













      0












      0








      0







      UploadTask



      public class UploadTask extends StorageTask<UploadTask.TaskSnapshot>


      An controllable task that uploads and fires events for success, progress and failure. It also allows pause and resume to control the upload operation.



      Example



      final StorageReference firebaseStorage = FirebaseStorage.getInstance().getReference();

      StorageReference postPhotos = firebaseStorage.child("photos/");

      final StorageReference upload_Image = postPhotos.child(uri.getLastPathSegment());

      //uri = uri of your file which you want to update
      UploadTask uploadTask = upload_Image.putFile(uri);
      uploadTask.addOnFailureListener(new OnFailureListener()
      @Override
      public void onFailure(@NonNull Exception e)


      );
      uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
      @Override
      public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
      upload_Image.getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>()
      @Override
      public void onComplete(@NonNull Task<Uri> task)
      if (task.isSuccessful())
      //downloadable uri
      Uri path = task.getResult();


      );

      );





      share|improve this answer















      UploadTask



      public class UploadTask extends StorageTask<UploadTask.TaskSnapshot>


      An controllable task that uploads and fires events for success, progress and failure. It also allows pause and resume to control the upload operation.



      Example



      final StorageReference firebaseStorage = FirebaseStorage.getInstance().getReference();

      StorageReference postPhotos = firebaseStorage.child("photos/");

      final StorageReference upload_Image = postPhotos.child(uri.getLastPathSegment());

      //uri = uri of your file which you want to update
      UploadTask uploadTask = upload_Image.putFile(uri);
      uploadTask.addOnFailureListener(new OnFailureListener()
      @Override
      public void onFailure(@NonNull Exception e)


      );
      uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
      @Override
      public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
      upload_Image.getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>()
      @Override
      public void onComplete(@NonNull Task<Uri> task)
      if (task.isSuccessful())
      //downloadable uri
      Uri path = task.getResult();


      );

      );






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Mar 25 at 11:49

























      answered Mar 25 at 8:43









      Ashvin solankiAshvin solanki

      1,789831




      1,789831












      • where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));

        – ANDROID_BIGGENER
        Mar 25 at 11:40












      • @ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes to upload_Image.putFile(uri);

        – Ashvin solanki
        Mar 25 at 11:50












      • @ANDROID_BIGGENER let me see if its not work....

        – Ashvin solanki
        Mar 25 at 11:52











      • thanks very much dear it worked 😘

        – ANDROID_BIGGENER
        Mar 25 at 12:10











      • @ANDROID_BIGGENER glad to help you mark as accepted if its work

        – Ashvin solanki
        Mar 25 at 12:12

















      • where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));

        – ANDROID_BIGGENER
        Mar 25 at 11:40












      • @ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes to upload_Image.putFile(uri);

        – Ashvin solanki
        Mar 25 at 11:50












      • @ANDROID_BIGGENER let me see if its not work....

        – Ashvin solanki
        Mar 25 at 11:52











      • thanks very much dear it worked 😘

        – ANDROID_BIGGENER
        Mar 25 at 12:10











      • @ANDROID_BIGGENER glad to help you mark as accepted if its work

        – Ashvin solanki
        Mar 25 at 12:12
















      where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));

      – ANDROID_BIGGENER
      Mar 25 at 11:40






      where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));

      – ANDROID_BIGGENER
      Mar 25 at 11:40














      @ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes to upload_Image.putFile(uri);

      – Ashvin solanki
      Mar 25 at 11:50






      @ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes to upload_Image.putFile(uri);

      – Ashvin solanki
      Mar 25 at 11:50














      @ANDROID_BIGGENER let me see if its not work....

      – Ashvin solanki
      Mar 25 at 11:52





      @ANDROID_BIGGENER let me see if its not work....

      – Ashvin solanki
      Mar 25 at 11:52













      thanks very much dear it worked 😘

      – ANDROID_BIGGENER
      Mar 25 at 12:10





      thanks very much dear it worked 😘

      – ANDROID_BIGGENER
      Mar 25 at 12:10













      @ANDROID_BIGGENER glad to help you mark as accepted if its work

      – Ashvin solanki
      Mar 25 at 12:12





      @ANDROID_BIGGENER glad to help you mark as accepted if its work

      – Ashvin solanki
      Mar 25 at 12:12













      0














      Use this Code to upload File on firebase and get download url for that file



      Uri file = Uri.fromFile(new File(aadhaarPath));
      final StorageReference riversRef = storageRef.child("documents/" + file.getLastPathSegment());
      uploadTask = riversRef.putFile(file);

      uploadTask.addOnFailureListener(new OnFailureListener()
      @Override
      public void onFailure(@NonNull Exception exception)
      progressDialog.dismiss();

      ).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
      @Override
      public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)

      // get the image Url of the file uploaded
      riversRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>()
      @Override
      public void onSuccess(Uri uri)
      Uri downloadUrl = uri;
      aadharDownloadUrl = downloadUrl.toString();
      uploadPanCard(panCardPath);

      );

      );


      aadhaarPath is file path that you selected to upload



      and add this in your build .gradle



      implementation 'com.google.firebase:firebase-storage:16.0.3'





      share|improve this answer



























        0














        Use this Code to upload File on firebase and get download url for that file



        Uri file = Uri.fromFile(new File(aadhaarPath));
        final StorageReference riversRef = storageRef.child("documents/" + file.getLastPathSegment());
        uploadTask = riversRef.putFile(file);

        uploadTask.addOnFailureListener(new OnFailureListener()
        @Override
        public void onFailure(@NonNull Exception exception)
        progressDialog.dismiss();

        ).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
        @Override
        public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)

        // get the image Url of the file uploaded
        riversRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>()
        @Override
        public void onSuccess(Uri uri)
        Uri downloadUrl = uri;
        aadharDownloadUrl = downloadUrl.toString();
        uploadPanCard(panCardPath);

        );

        );


        aadhaarPath is file path that you selected to upload



        and add this in your build .gradle



        implementation 'com.google.firebase:firebase-storage:16.0.3'





        share|improve this answer

























          0












          0








          0







          Use this Code to upload File on firebase and get download url for that file



          Uri file = Uri.fromFile(new File(aadhaarPath));
          final StorageReference riversRef = storageRef.child("documents/" + file.getLastPathSegment());
          uploadTask = riversRef.putFile(file);

          uploadTask.addOnFailureListener(new OnFailureListener()
          @Override
          public void onFailure(@NonNull Exception exception)
          progressDialog.dismiss();

          ).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
          @Override
          public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)

          // get the image Url of the file uploaded
          riversRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>()
          @Override
          public void onSuccess(Uri uri)
          Uri downloadUrl = uri;
          aadharDownloadUrl = downloadUrl.toString();
          uploadPanCard(panCardPath);

          );

          );


          aadhaarPath is file path that you selected to upload



          and add this in your build .gradle



          implementation 'com.google.firebase:firebase-storage:16.0.3'





          share|improve this answer













          Use this Code to upload File on firebase and get download url for that file



          Uri file = Uri.fromFile(new File(aadhaarPath));
          final StorageReference riversRef = storageRef.child("documents/" + file.getLastPathSegment());
          uploadTask = riversRef.putFile(file);

          uploadTask.addOnFailureListener(new OnFailureListener()
          @Override
          public void onFailure(@NonNull Exception exception)
          progressDialog.dismiss();

          ).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
          @Override
          public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)

          // get the image Url of the file uploaded
          riversRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>()
          @Override
          public void onSuccess(Uri uri)
          Uri downloadUrl = uri;
          aadharDownloadUrl = downloadUrl.toString();
          uploadPanCard(panCardPath);

          );

          );


          aadhaarPath is file path that you selected to upload



          and add this in your build .gradle



          implementation 'com.google.firebase:firebase-storage:16.0.3'






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 25 at 5:26









          Sandeep ParishSandeep Parish

          1,2361316




          1,2361316





















              0














              I save photos to Firebase storage and the image name to Firebase realtime database and than i am using Glide to load images from Firebase Storage:



               FirebaseStorage storage = FirebaseStorage.getInstance();
              StorageReference storageRef = storage.getReference();
              StorageReference imageRef = storageRef.child(PHOTO_NAME);

              GlideApp.with(mContext).load(islandRef).into(viewHolder.image);





              share|improve this answer



























                0














                I save photos to Firebase storage and the image name to Firebase realtime database and than i am using Glide to load images from Firebase Storage:



                 FirebaseStorage storage = FirebaseStorage.getInstance();
                StorageReference storageRef = storage.getReference();
                StorageReference imageRef = storageRef.child(PHOTO_NAME);

                GlideApp.with(mContext).load(islandRef).into(viewHolder.image);





                share|improve this answer

























                  0












                  0








                  0







                  I save photos to Firebase storage and the image name to Firebase realtime database and than i am using Glide to load images from Firebase Storage:



                   FirebaseStorage storage = FirebaseStorage.getInstance();
                  StorageReference storageRef = storage.getReference();
                  StorageReference imageRef = storageRef.child(PHOTO_NAME);

                  GlideApp.with(mContext).load(islandRef).into(viewHolder.image);





                  share|improve this answer













                  I save photos to Firebase storage and the image name to Firebase realtime database and than i am using Glide to load images from Firebase Storage:



                   FirebaseStorage storage = FirebaseStorage.getInstance();
                  StorageReference storageRef = storage.getReference();
                  StorageReference imageRef = storageRef.child(PHOTO_NAME);

                  GlideApp.with(mContext).load(islandRef).into(viewHolder.image);






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 25 at 8:03









                  nadav tamimnadav tamim

                  367




                  367



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55331560%2ffirebase-storage-getting-downloadurl-problem%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                      SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                      은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현