Fixed handling of uploaded files.