That is exactly what you proposed (apart from the bit about the file size, since it actually applies to any instance when the file failed to upload)...
;)