Archived from the Transloadit support forum. Originally posted on September 7, 2011; details may be outdated, see our docs for current behavior. Original thread
I’m trying to limit the size of the upload. This is a very rough version, but please let me know how I can better it.
Example for files under 10 megs
onProgress: function(bytesReceived, bytesExpected) {
if(parseInt(bytesExpected) > 10500)
{
$('#progress').fadeOut();
$('#MyForm').transloadit('cancel');
$('#MyForm').transloadit('stop');
alert('This upload exceeds the size limit');
}
}