Fixing upload buffer length check.