title: not able to get full real path with name of selected file
body: <p>I am not geting currect path var name &quot;FilePath&quot;  im geting value  E/File path: /document/29  but my selected file stored in downloads folder file name is &quot;test.xlsx&quot;   i need original path with file name with file extention to pass  in FileInputStream().I am not able to fix it ...can anybody give the code</p>
  <p>btnimport.setOnClickListener(new View.OnClickListener() {</p>
  <pre><code>            @Override
              public void onClick(View v) {
                  Intent fileintent = new Intent(Intent.ACTION_GET_CONTENT);
                  fileintent.setType(&quot;*/*&quot;);
                  try {
                      startActivityForResult(fileintent, requestcode);
                  } catch (ActivityNotFoundException e) {
                      lbl.setText(&quot;No activity can handle picking a file. Showing alternatives.&quot;);
                  }
  
  
  
  
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          if (data == null)
              return;
          switch (requestCode) {
              case requestcode:
                  String FilePath = data.getData().getPath();
  
                  Log.e(&quot;File path&quot;, FilePath);
  
                  if (FilePath.contains(&quot;/root_path&quot;))
                      FilePath = FilePath.replace(&quot;/root_path&quot;, &quot;&quot;);
  
                  Log.e(&quot;New File path&quot;, FilePath);
  
                  try {
                      if (resultCode == RESULT_OK) {
                          AssetManager am = this.getAssets();
                          InputStream inStream;
                          Workbook wb = null;
  
                          try {
                              inStream = new FileInputStream(FilePath);
                              Log.e(&quot;Extension&quot;,FilePath.substring(FilePath.lastIndexOf(&quot;.&quot;)));
  
                              if (FilePath.substring(FilePath.lastIndexOf(&quot;.&quot;)).equals(&quot;.xls&quot;)) {
                                  Log.e(&quot;File Type&quot;, &quot;Selected file is XLS&quot;);
                                  wb = new HSSFWorkbook(inStream);
                              }
                              else if (FilePath.substring(FilePath.lastIndexOf(&quot;.&quot;)).equals(&quot;.xlsx&quot;)) {
                                  Log.e(&quot;File Type&quot;, &quot;Selected file is XLSX&quot;);
                                  wb = new XSSFWorkbook(inStream);
                              }
                              else {
                                  wb = null;
                                  lbl.setText(&quot;Please select a valid Excel file&quot;);
                                  return;
  
                              }
  
                              inStream.close();
  </code></pre>