Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
2.4 kB
1
Indexable
Never
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
  <title>Document</title>
</head>
<body style="background-color:rgb(141, 179, 179);">


  <form id="form" action="/user" enctype="multipart/form-data" method="post" style=" margin-right: 30%;margin-left: 20%;margin-top: 5%;">
 
    <div class="mb-3">
        <label for="formFile" class="form-label">Accepted file format: .pdf</label> 
        <input class="form-control" type="file" value="" accept="application/pdf" name="file" >
      </div>
   <button id="btn">Upload</button>
  
   <br>
   <br>
   <table method="post" action="/data"class="table table-striped" id="foo">
    <thead>
        <tr>
            <th>File Name</th>
           
        </tr>
    </thead>
  </table>
    <tbody>  
   
   
      <div id='test'></div>
       
          <script type="text/javascript">
         
            let url="http://localhost:3000/files";
            fetch(url).then(response => response.json())
            .then( (result) => {
             
            
      for(let i=0;i<result.length;i++)
       
          document.getElementById('test').innerHTML += `
          <tbody>  
				<div>
				<tr>
		<td>${result[i].filename}</td><br>
</tr>
			  
</tbody>   </div>
				 `;
		})
	  .catch(error => console.log('error:', error));
        </script>
           
          </tr> 
          
     
     



</form>

  

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>



</body>


</html>