title: how to name image files dynamicly from intent
body: <p>in this <a href="https://stackoverflow.com/questions/23777027/getting-image-name-of-image-selected-from-gallery-in-android">question</a> explain how to get the name of an image </p>
  
  <pre><code>File f = new File(picturePath);
  String imageName = f.getName();
  </code></pre>
  
  <p>however I am getting the image as an intent , how to get the name of it ?</p>
  
  <pre><code> Intent intent = new Intent();
              intent.setType("image/*");
              intent.setAction(Intent.ACTION_GET_CONTENT);
              startActivityForResult(Intent.createChooser(intent, "Select Picture"), 1);
  </code></pre>
  
  <p>another sub question.</p>
  
  <p>I am uploading an image from gallery to server, so I though the name of the image uploaded to the server should be the same founded in gallery adding date to it ? is there another way you advice for me ?</p>
  
  <p>this is php that name the file its static now which is bad</p>
  
  <pre><code> $base=$_REQUEST['image'];
       $binary=base64_decode($base);
      header('Content-Type: bitmap; charset=utf-8');
      $file = fopen('uploaded_images.jpg', 'wb');
      fwrite($file, $binary);
  </code></pre>
  
  <p>edit</p>
  
  <pre><code> startActivityForResult(Intent.createChooser(intent, "Select Picture"), 1);
  
              // startActivityForResult(
                // Intent.createChooser(intent, "Complete action using"),2);
             }
  
             @Override
             protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  
                 super.onActivityResult(requestCode, resultCode, data);
  
                  if (requestCode == 1 &amp;&amp; resultCode == RESULT_OK &amp;&amp; data != null &amp;&amp; data.getData() != null) {
  
                      //file name
                      filePath = data.getData();
                      try {
                      //  Bundle extras2 = data.getExtras();
                          bitmap  = MediaStore.Images.Media.getBitmap(getContentResolver(), filePath);
                        //  imageview.setImageBitmap(bitmap);
                          ByteArrayOutputStream stream = new ByteArrayOutputStream();
                          bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
  
                         byte imageInByte[] = stream.toByteArray();
  
                        Intent i = new Intent(this,
                                  AddImage.class);
                        i.putExtra("image", imageInByte);
                        startActivity(i);
  
                      } catch (IOException e) {
                          e.printStackTrace();
                      }
                  }
             }
  </code></pre>