Fixes external URL download for fileEntities and creation of externalFileEntities

Also some more verbose error messages on http errors (this needs to be refactored into a separate function however so  we don't need this verbose code everywhere.