public function storeUploadedFile(File $tmpFile, $name = '')
    {
        $ext = common_ext_ExtensionsManager::singleton()->getExtensionById('tao');
        $fsId = $ext->getConfig(self::CONFIG_UPLOAD_FILESOURCE);
        $fss = $this->getServiceLocator()->get(FileSystemService::SERVICE_ID);
        $baseDir = $fss->getDirectory($fsId);
        do {
            $unique = uniqid();
            $dir = implode('/',str_split(substr($unique, 0, 3))).'/'.substr($unique, 3);
            $file = $baseDir->getFile($dir.'/'.$name);
        } while ($file->exists());
        $file->write($tmpFile->read());
        $referencer = $this->getServiceLocator()->get(FileReferenceSerializer::SERVICE_ID);
        $serial = $referencer->serialize($file);
        return $serial;
    }