Problem with uploading a file using the importer

Permalink
Hello all,

I am using the file importer as instructed in the documentation to upload a file from an external url. I am printing the error message and receiving an "unknown error" I am not sure what could be the problem. Any help would be appreciated.

My code:
Loader::library("file/importer");
                    $fi = new FileImporter();
                    $newFile = $fi->import('http://www.anexternalsite.com/files/image.jpg');
                    print FileImporter::getErrorMessage($errorCode);