Fixes error handling with file uploads

When there was a real error it was being converted to 9. I think it
would be converted to 9 if there isn't any other errors.

e.g.

When you excees the maximum size (error 2) the filesize appears to be 0
therefore currently it would be converted to 9 whilst the real error is
2.