Tidied up the way the URL class handles file uploads, and added support for in-memory uploads.