Hack to handle both form uploads and CURL PUT.