title: creating new text file() with javascript but storing [objectFile] instead of text
body: <p>I'm working on a project to encrypting data and sent it to the server, so I need to store the data in a file and then sent it to the server(php). the user then grab the file on the client side to decrypt it. But I'm runing into the problem of storing the data in the text file or open it.</p>
  
  <p>I have no problem creating the file, but when I open the file/use FileReader(), it said: [objectFile] instead of the data.</p>
  
  <p>What am I doing wrong? Here is an example below, I try to make it as simple as possible. 
  note: I can't read jquery.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;script&gt;
              function createdTextFile(){
                  var date = new Date();
                  var file = new File(["text text text text text text"], "textfile.txt", {type: "text", lastModified: date});
              /*
                  sent file to server
                  var formdata = new FormData();
                  formdata.append("Uploaded_file", file);                     
              */
  
                  //Created download link
                  var uriContent = "data:application/octet-stream,"+file;
                  var div_idFileDownload = document.getElementById("file_dowload");
                  div_idFileDownload.innerHTML = "";
                  var createElement_aFileDownload = document.createElement("a");
                      createElement_aFileDownload.setAttribute("download", "textfile.txt");
                      createElement_aFileDownload.setAttribute("href", uriContent);
                      div_idFileDownload.appendChild(createElement_aFileDownload);
                  var nm = document.createTextNode("textfile.txt");
                      createElement_aFileDownload.appendChild(nm);
              }
              //open text file: [objectFile]
              //Need the text file to say: text text text text text text
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;input type="file" id="upload_img"&gt;
      &lt;input type="button" onclick ="createdTextFile()" value="download"&gt;
      &lt;div id="file_dowload"&gt;&lt;div/&gt;
  &lt;/html&gt;
  </code></pre>