In my html form, I'm uploading a number of files to the server:
<form action="${uploadUrl}" method="post" enctype="multipart/form-data">
<input type="file" name="myFile" multiple>
<input type="submit" value="Submit">
</form>
However, I want to add a condition on the size of the uploaded file. If the file is smaller than for example 1MB, I want to upload it to a different uploadUrl
and if it is larger than that, I would like to upload it to another url. How can I achieve this?
It gets more difficult when I'm uploading several files at a same time.