Add support for uploaded files.
Fixed encoding issues.