20210218

20210218

  h1 #{title}
  p this is #{title}
  p Upload your fasta file below
  form(action="./upload" method="POST" enctype="multipart/form-data")
    input(type="file", name="file" id="inputfile")
    button(type="button" onclick="file_upload()" value="Upload")
  p(id="text") 
  //script(src="./javascripts/main.js")
  script.
      var slice_size = 100 * 1024 * 1024;
      var files;
      var file;
      var slice_file;
      var reader = new FileReader();
      var content;
      var fileData = {};
      
      function file_upload() {
          var slice_file = $("#inputfile")[0].files[0].slice(0,slice_size);
          reader.readAsText(slice_file);
          reader.onload = function() {
             content = reader.result;
          }
          fileData.fileContent = content;
          $.ajax({
              type: "POST",
              url: "./upload/",
              data: fileData,
              dataType: "json",
          })
          .done(function(res){
              console.log("success");
          })
          .fail(function(res){
              console.log("falied");
          });
      }
  • 20210218.1613628632.txt.gz
  • 最終更新: 2021/02/18 06:10
  • by 133.11.144.10