private async Task <DataFileInfo> GetFallbackDataFileInfo(Guid releaseId, File file) { // Try to get the name from the zip file if existing if (file.SourceId != null) { var source = await _fileRepository.Get(file.SourceId.Value); if (await _blobStorageService.CheckBlobExists(PrivateFilesContainerName, source.Path())) { var zipBlob = await _blobStorageService.GetBlob(PrivateFilesContainerName, source.Path()); var importStatus = await _importStatusService.GetImportStatus(releaseId, file.Filename); return(new DataFileInfo { Id = file.Id, FileName = file.Filename, Name = zipBlob.Name, Path = file.Filename, Size = zipBlob.Size, MetaFileId = null, MetaFileName = file.Type == FileType.Data ? zipBlob.GetMetaFileName() : string.Empty, Rows = 0, UserName = zipBlob.GetUserName(), Status = importStatus.Status, Created = zipBlob.Created, Permissions = await _userService.GetDataFilePermissions(releaseId, file.Filename) }); } } var dataFileName = file.Type == FileType.Data ? file.Filename : (await GetAssociatedReleaseFileReference(file, FileType.Data)).Filename; var metaFileReference = file.Type == FileType.Data ? await GetAssociatedReleaseFileReference(file, Metadata) : null; var metaFileName = metaFileReference?.Filename ?? ""; // Fail the import if this was a datafile upload await _importService.FailImport( releaseId, dataFileName, metaFileName, new List <ValidationError> { new ValidationError("Files not uploaded correctly. Please delete and retry") }.AsEnumerable() ); return(new DataFileInfo { Id = file.Id, FileName = file.Filename, Name = await GetSubjectName(file), Path = file.Filename, Size = "0.00 B", MetaFileId = metaFileReference?.Id, MetaFileName = metaFileReference?.Filename ?? "", Rows = 0, UserName = "", Status = IStatus.NOT_FOUND, Permissions = await _userService.GetDataFilePermissions(releaseId, dataFileName) }); }