I am trying to check file size upload in jinja2 template in django. I want to check it before it gets uploaded, the code below is a form which will be submitted after clicking the button. It will upload a dataset in browser.
<form method="POST" class="post-form" enctype="multipart/form-data">
{{ form.as_p }}
<button onclick="onSubmitBtn()" type="submit" id="btn-hide" class="btn btn-danger">Upload</button>
</form>