Silence undefined variable warnings when uploading

When uploading a file if `size` was not set then it would output a warning in the response. This caused the JSON response to be invalid and thus fail parsing.