title: Raw File path access of file at JavaScript in Android 11.(scoped-storage)
body: <p><a href="https://developer.android.com/training/data-storage#scoped-storage" rel="nofollow noreferrer">https://developer.android.com/training/data-storage#scoped-storage</a></p>
  <p><strong>Device name:</strong>
  User-Agent: Mozilla/5.0 (Linux; Android 11; Pixel 3a Build/RPB1.200504.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.106 Mobile Safari/537.36</p>
  <p>1)android targetSdkVersion 30 requestLegacyExternalStorage = false.</p>
  <pre><code>android {
      compileSdkVersion 30
      defaultConfig {
          applicationId &quot;com.example.ui&quot;
          minSdkVersion 21
          targetSdkVersion 30
          }
       }
      }
  </code></pre>
  <ol start="2">
  <li>file path or URL
  lFileUrl = file:///data/user/0/com.example.ui/files/KK&amp;T SEW_temp/IMG-20200630-223714.jpg</li>
  </ol>
  <p>XMLHttpRequest request done from javascript level in cordova based android app.</p>
  <pre><code>var xhr = new XMLHttpRequest();
  xhr.open(&quot;GET&quot;, lFileUrl, true);
  xhr.responseType = &quot;blob&quot;;
  UI.Util.info(&quot;PtxUtils.getInlineAttachmnetJson() &gt;&gt; inside xhr.open&quot;);
  xhr.onload = function(e) {
  try {
  UI.Util.info(&quot;PtxUtils.getInlineAttachmnetJson() &gt;&gt; inside xhr.onload&quot;);
  }
                  
  </code></pre>
  <p>3)XMLHttpRequest throwing error</p>
  <pre><code>ERR_ACCESS_DENIED, when getFilesDir() API used.
  PtxUtils.js:2950 GET 
  
  file:///data/user/0/com.example.ui/files/KK&amp;T%20SEW_temp/IMG-20200630-223714.jpg net::ERR_ACCESS_DENIED
  
  23:09:57.058 PtxUtils.js:2950 XHR failed loading: GET &quot;file:///data/user/0/com.example.ui/files/KK&amp;T%20SEW_temp/IMG-20200630-223714.jpg&quot;.
  </code></pre>
  <p>4)XMLHttpRequest throwing error</p>
  <pre><code>ERR_ACCESS_DENIED, when getExternalFilesDir()() API used.
  
  PtxUtils.js:2950 GET file:///storage/emulated/0/Android/data/com.example.ui/files/KK&amp;T%20SEW_temp/IMG-20200701-135735.jpg net::ERR_ACCESS_DENIED
  
  PtxUtils.js:2950 XHR failed loading: GET &quot;file:///storage/emulated/0/Android/data/com.example.ui/files/KK&amp;T%20SEW_temp/IMG-20200701-135735.jpg&quot;.    
  </code></pre>
  <p>5)android targetSdkVersion 29 requestLegacyExternalStorage = false</p>
  <pre><code>with getFilesDir() path getExternalFilesDir() XMLHttpRequest is pass with no error, file data is retrieved.
  
  
  
  
                          
  </code></pre>