title: How to upload Multiple Images to firebase and get the URL in separate childs just am getting all the URL in one child value
body: <pre><code>public class MainActivity extends AppCompatActivity {
  
      String key;
      private ImageView mImageView;
      private FirebaseStorage mStorageRef;
      private Button mButton;
      private StorageTask mUploadTask;
      private List&lt;Uri&gt; uploadedImages = new ArrayList&lt;&gt;();
  
      private DatabaseReference mRefre;
      ArrayList&lt;String&gt; filepath = new ArrayList&lt;&gt;();
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          mImageView = (ImageView) findViewById(R.id.hhhh);
  
          mRefre = FirebaseDatabase.getInstance().getReference();
          mButton = (Button) findViewById(R.id.addphoto);
  
          mButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
  
                  filepath.clear();
  
                  FilePickerBuilder.getInstance().setMaxCount(3)
                          .setSelectedFiles(filepath)
                          .setActivityTheme(R.style.AppTheme)
                          .pickPhoto(MainActivity.this);    
              }
          });
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          switch (requestCode) {
  
              case FilePickerConst.REQUEST_CODE:
  
                  if (resultCode == RESULT_OK &amp;&amp; data != null) {
  
                      final ArrayList&lt;String&gt; filepath;
                      filepath = data.getStringArrayListExtra(FilePickerConst.KEY_SELECTED_PHOTOS);
  
                      filepath.add("image1");
                      filepath.add("image2");
  
                      for (String path : filepath) {
  
                          final Uri file = Uri.fromFile(new File(path));
                          key = mRefre.child("products").push().getKey();
  
                          StorageReference photoRef = FirebaseStorage.getInstance().getReference("Images").child(uploadedImages + file.getLastPathSegment());
  
                          mUploadTask = photoRef.putFile(file);
                          mUploadTask.addOnSuccessListener(new OnSuccessListener&lt;UploadTask.TaskSnapshot&gt;() {
                              @Override
                              public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
  
                                  Uri downloadUrl = taskSnapshot.getDownloadUrl();
                                  uploadedImages.add(downloadUrl);
  
                                  HashMap userMap = new HashMap();
                                  userMap.put("image1",uploadedImages.toString());
                                  userMap.put("image2",uploadedImages.toString());
                                  mRefre.child("product-images").setValue(userMap);
                              }
                          });    
                      }
                  }
          }
      }
  }
  </code></pre>
  
  <p>I am doing firebase project and trying to upload multiple images using imagepicker with a maximum of 3 images. The images are successfully uploaded to firebase storage but when I try to get the URL it saves the 3 images in one child Value. I am trying to save it in separate values and name them so I can retrieve them later.</p>
  
  <p>How can I fix this?</p>
  
  <p><a href="https://i.stack.imgur.com/ljPgz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ljPgz.png" alt="Image"></a></p>