title: GET https://localhost/fetch/doc.xml 404 (Not Found)
body: <p>Good evening, I am a beginner, I am on an application where the client has to download one of the xml files, but when the file is in local folder it downloads it and when it is elsewhere, it says:
  <code>GET https://localhost/dossier/data.xml 404 (Not Found)</code>.</p>
  <p>How to make it accept the file no matter where it is?</p>
  <p>This is the code:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;form id=&quot;parcourir&quot;&gt;
     &lt;input type=&quot;file&quot; id=&quot;real-file&quot; hidden=&quot;hidden&quot; /&gt;
     &lt;button type=&quot;button&quot; id=&quot;custom-button&quot;&gt;Parcourir&lt;/button&gt; &lt;br&gt;
     &lt;span id=&quot;custom-text&quot;&gt;Aucun fichier selectionné&lt;/span&gt;
  &lt;/form&gt;
  &lt;script&gt;
     const realFileBtn = document.getElementById(&quot;real-file&quot;);
     const customBtn = document.getElementById(&quot;custom-button&quot;);
     const customTxt = document.getElementById(&quot;custom-text&quot;);
     
     customBtn.addEventListener(&quot;click&quot;, function () {
         realFileBtn.click();
     })
     realFileBtn.addEventListener(&quot;change&quot;, function () {
         if (realFileBtn.value) {
             customTxt.innerHTML = realFileBtn.value.match(/[\/\\]([\w\d\s\.\-\(\)]+)$/)[1];
             console.log(location.href);
             console.log(customTxt.innerHTML);
             myFunction(this);
     
         } else {
             customTxt.innerHTML = &quot;no file choosen yet&quot;;
         }
         var xhttp = new XMLHttpRequest();
         xhttp.onreadystatechange = function () {
             if (this.readyState == 4 &amp;&amp; this.status == 200) {
     
                 myFunction(this);
             }
         };
         xhttp.open(&quot;GET&quot;, customTxt.innerHTML, true);
         xhttp.onload = (response) =&gt; {
             console.log(xhttp.response);
         }
         xhttp.send();
     })
     function myFunction(xml) {
         var xmlDoc = xml.responseXML;
         console.log(xmlDoc);
     }
  &lt;/script&gt;
  </code></pre>