The file is copied using the local file trigger node of n8n, but the size of the copied file is 1kb

hi,
I am using n8n Desktop on Windows OS.
Connect the shared folder on the NAS as a network drive (Z:) and
Whenever a file is added to the shared folder, the file is copied to a specific folder on the D drive using the local file trigger node of n8n.

xcopy /F /R /Y /I “{{$json[“path”]}}” “D:/InputFiles/InternalDigitalCard/{{DateTime.now().toFormat(‘yyyyMMdd’)}}/”

Copy the file using the above expression.
However, most files are 1kb in size.
So the PDF file won’t open in Acrobat Reader.
Occasionally, a normally copied file exists.

Could this be because an event occurred while a file was being written to the shared folder?

thank you

Hey @HeeHang_Seo,

What is the content of the file if you open it in Notepad? is it empty or does it contain a message?

The folder contains PDF files for Print Press.

That is interesting so it looks like it has started then and might be going a bit early.

What you could do is in your workflow create a loop to check the file size then wait 1 second and check it again and compare the 2 values, if they are the same move on with the copy if not continue looping.