# "Copy File" node does not copy despite error checks

**URL:** <https://forums.unrealengine.com/t/copy-file-node-does-not-copy-despite-error-checks/2284690>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [January 18, 2025, 10:22am UTC](https://forums.unrealengine.com/t/copy-file-node-does-not-copy-despite-error-checks/2284690 "2025-01-18T10:22:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Airner](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Airner](https://forums.unrealengine.com/u/Airner)\
**Post date:** [January 18, 2025, 10:22am UTC](https://forums.unrealengine.com/t/copy-file-node-does-not-copy-despite-error-checks/2284690/1 "2025-01-18T10:22:02Z")

</div>

This setup should copy the file from one folder to another, but it does not work for me  
Im checking if the Source File is exist which it does, and checked the Target Directory also exist  
Testing in editor in UE5.5  
I imagine that my input strings might be incorrect?  
If that is the case, how should I modify then, how would it be correct?

I would really appreciate if someone could point me in the right direction, what am I missing 🙂

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/1/7/417501c15c6704147703d0093a5fe3b54d68d5d7.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/2/c/52cc58ff86ced447bfe4949bcc1dac2afbbe4d74.jpeg)

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [January 18, 2025, 6:35pm UTC](https://forums.unrealengine.com/t/copy-file-node-does-not-copy-despite-error-checks/2284690/2 "2025-01-18T18:35:24Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/9/4/594b5a70c2d4f3b312ea186b098eda2ffe3f40c8.png)

You need Get Project Saved Directory

The copy file node only works with revision control. If you don’t have a project setup then it will fail.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/5/5f5471e94b0697fa79e2832fbcc991792fa58380.png)

I would just make a blueprint function library in c++ to copy the file.

---

<div class="post-metadata">

**Author:** ![Airner](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Airner](https://forums.unrealengine.com/u/Airner)\
**Post date:** [January 19, 2025, 5:46am UTC](https://forums.unrealengine.com/t/copy-file-node-does-not-copy-despite-error-checks/2284690/4 "2025-01-19T05:46:11Z")

</div>

Thank you for the quick answer!

So, if I understand this correctly, the Copy File node will NOT work in a Shipped build?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [January 19, 2025, 9:08am UTC](https://forums.unrealengine.com/t/copy-file-node-does-not-copy-despite-error-checks/2284690/5 "2025-01-19T09:08:53Z")

</div>

I highly doubt it. You will need to access the pure file related functions in c++

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [January 19, 2025, 10:49am UTC](https://forums.unrealengine.com/t/copy-file-node-does-not-copy-despite-error-checks/2284690/6 "2025-01-19T10:49:48Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/0/5/4058f7dfcbcc1e051f085a3c31ddd1e17c19030f.png)

.h

```auto
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "FileLibrary.generated.h"

/**
 * 
 */
UCLASS()
class COPYSAVE_API UFileLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

public:
	UFUNCTION(BlueprintCallable, Category="File Operations")
	static bool CopyFile(FString SourceFile, FString TargetFile);

};

```

.cpp

```auto
// Fill out your copyright notice in the Description page of Project Settings.

#include "FileLibrary.h"

bool UFileLibrary::CopyFile(FString SourceFile, FString TargetFile)
{
	IPlatformFile& platformFile = FPlatformFileManager::Get().GetPlatformFile();	
	if (FPaths::FileExists(SourceFile))
	{		
		UE_LOG(LogTemp, Error, TEXT("Source file %s does not exist"), *SourceFile);
		return platformFile.CopyFile(*TargetFile, *SourceFile);
	}
	else return false;
}

```

outcome

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/2/2/522b3aa784908d1872d7e9e12f23d0ba0191288b.png)

Lol ok I made it a plugin and then only realized that unreal already has a file operation blueprint library that covers file operations 🤷

Go into plugins and enable Blueprint file utilities

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/e/12e0d3deee946b9f6a0ecacfa2eaa9203c79ebe4.png)

The copy file will do the same as my code 😛

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/d/27d75e15b6fe7d59136448fe128d3dcc3637d746.png)

I can confirm that it works in the packed version of the game!

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/e/6cede18fd1b08cd9cd76b10a170686b565456fd4.png)

---

<div class="post-metadata">

**Author:** ![Airner](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Airner](https://forums.unrealengine.com/u/Airner)\
**Post date:** [January 20, 2025, 6:14am UTC](https://forums.unrealengine.com/t/copy-file-node-does-not-copy-despite-error-checks/2284690/7 "2025-01-20T06:14:19Z")

</div>

That is the one, thank you so much! 🙂

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [February 19, 2025, 6:14am UTC](https://forums.unrealengine.com/t/copy-file-node-does-not-copy-despite-error-checks/2284690/8 "2025-02-19T06:14:38Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
