Skip to content

Commit

Permalink
Merge pull request #204 from Nfactor26/fix-issue-with-downloading-ini…
Browse files Browse the repository at this point in the history
…tialization-script

Correct file path when downloading data file by name
  • Loading branch information
Nfactor26 authored Dec 30, 2022
2 parents a848dd9 + 7224ce8 commit 887ba1c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ public async Task DownloadProjectDataFileByNameAsync(AutomationProject automatio
if (IsOnlineMode)
{
var file = await this.filesClient.DownProjectDataFile(automationProject.ProjectId, projectVersion.ToString(), fileName);
var projectDirectory = Path.Combine(this.applicationFileSystem.GetAutomationProjectWorkingDirectory(automationProject, projectVersion));
using (MemoryStream ms = new MemoryStream(file.Bytes))
{
using (FileStream fs = new FileStream(file.FilePath, FileMode.CreateNew))
using (FileStream fs = new FileStream(Path.Combine(projectDirectory, file.FilePath), FileMode.Create))
{
ms.Seek(0, SeekOrigin.Begin);
ms.CopyTo(fs);
Expand Down

0 comments on commit 887ba1c

Please sign in to comment.