Skip to content

Commit 887ba1c

Browse files
authored
Merge pull request #204 from Nfactor26/fix-issue-with-downloading-initialization-script
Correct file path when downloading data file by name
2 parents a848dd9 + 7224ce8 commit 887ba1c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Pixel.Persistence.Services.Client/DataManagers/ProjectDataManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ public async Task DownloadProjectDataFileByNameAsync(AutomationProject automatio
114114
if (IsOnlineMode)
115115
{
116116
var file = await this.filesClient.DownProjectDataFile(automationProject.ProjectId, projectVersion.ToString(), fileName);
117+
var projectDirectory = Path.Combine(this.applicationFileSystem.GetAutomationProjectWorkingDirectory(automationProject, projectVersion));
117118
using (MemoryStream ms = new MemoryStream(file.Bytes))
118119
{
119-
using (FileStream fs = new FileStream(file.FilePath, FileMode.CreateNew))
120+
using (FileStream fs = new FileStream(Path.Combine(projectDirectory, file.FilePath), FileMode.Create))
120121
{
121122
ms.Seek(0, SeekOrigin.Begin);
122123
ms.CopyTo(fs);

0 commit comments

Comments
 (0)