<!--views/admin/upload.ejs-->
<link href="/styles/admin/upload.css" rel="stylesheet"></link>
<div class='Upload'>
<% if(data.fileUrl){ %>
<form action='/admin/upload' method='post' enctype="multipart/form-data">
<input type='file' name='uploadFile' required />
<input type='text' value='<%= data.fileUrl %>'
placeholder='តំណរភ្ជាប់ឯកសារនៅលើ Server' />
<input type='submit' value='បញ្ជូនទិន្នន័យ' />
</form>
<% delete data.fileUrl %>
<% }else{ %>
<form action='/admin/upload' method='post' enctype="multipart/form-data">
<input type='file' name='uploadFile' required />
<input type='text' placeholder='តំណរភ្ជាប់ឯកសារនៅលើ Server' />
<input type='submit' value='បញ្ជូនទិន្នន័យ' />
</form>
<% } %>
</div>
/* static/styles/admin/upload.css */
.Upload form{
display: grid;
grid-template-columns: 50%;
grid-gap: 3px;
}
.Upload form input{
font: var(--body-font);
padding: 2px 5px;
}
.Upload form input[type="file"]{
padding: 0;
color: black;
background: white;
}