title: HTML Input file upload saved as very long url without PHP, AJAX, or jQuery
body: <p>I have a website where you can upload files and it will be saved in a database, but is there a way where the url doesn't have to be 1 million characters long? Here's the code for uploading</p>
  
  <pre><code>function readImg(input, eltID) {
          if (input.files &amp;&amp; input.files[0]) {
              var reader = new FileReader();
              reader.onload = function (e) {
                  document.getElementById(eltID).style.backgroundImage = 'url('+e.target.result+')';
              };
          reader.readAsDataURL(input.files[0]);
          }
  }
  </code></pre>
  
  <p>Which generates this:</p>
  
  <p><a href="https://i.stack.imgur.com/yPQ2L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yPQ2L.png" alt="enter image description here"></a></p>
  
  <p>Any solution?</p>
  
  <p>I'm also not using any form. Using input type=file</p>