Is it possible to be certain that the %FileSize is retrieving the value it should be retrieving? Because I really do not understand why the percentage should turn negative. Your script makes complete sense to me.
Just a quick note on what I am doing - I have set the maximum quota to 10MB and tried to upload a 21.4MB file with your script (without my addition) in the OnQuotaExceeded under the HTTP events, Lua Script Enabled.
I get the Upload Error: Exceeded quota error as it should be, but the quota ends up with the quota bar at -102939.57% and the Quota: -10793996288 Bytes / 10MB
Any help is greatly appreciated.
