Skip to content

Instantly share code, notes, and snippets.

@timsavery
Created March 5, 2013 22:33
Show Gist options
  • Save timsavery/5094959 to your computer and use it in GitHub Desktop.
Save timsavery/5094959 to your computer and use it in GitHub Desktop.
public Stream RetrieveReportFileChunkable(int reportID, Chatham.Libraries.Enumerations.Report reportType)
{
FileInfo targetFile;
if (reportType == Chatham.Libraries.Enumerations.Report.FMSDataIntegration)
{
// We save data feed files as xml
targetFile = new FileInfo(DocumentManagementHelper.CachedDataFeedFileName(reportID));
}
else
{
targetFile = new FileInfo(DocumentManagementHelper.CachedReportFileName(reportID));
}
using (var stream = targetFile.Open(FileMode.Open, FileAccess.Read, FileShare.Read)) {
return stream;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment