Skip to content

Commit

Permalink
Fix stream reading bug (OrchardCMS#17294)
Browse files Browse the repository at this point in the history
Fixes OrchardCMS#17291 by specifying that both Read and Write access are needed on the FileStream used for reading PDF files.  This bug was observed when indexing PDFs stored in Azure Blog Storage.
  • Loading branch information
cbadger-montecitobank authored Jan 2, 2025
1 parent 0397597 commit c0d252c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public async Task<string> GetTextAsync(string path, Stream fileStream)
{
if (!fileStream.CanSeek)
{
seekableStream = new FileStream(Path.GetTempFileName(), FileMode.OpenOrCreate, FileAccess.Write, FileShare.None, 4096, FileOptions.DeleteOnClose);
seekableStream = new FileStream(Path.GetTempFileName(), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None, 4096, FileOptions.DeleteOnClose);

await fileStream.CopyToAsync(seekableStream);

Expand Down

0 comments on commit c0d252c

Please sign in to comment.