Software & SaaSEngineering note

Files Copied Over Remote Desktop Were Cut Off at 256 KB. They Looked Fine.

A file can have the right name and the right size and still be mostly empty. If a copy matters, compare a checksum on both sides before you use it, and move large folders as one zip.

Author

CrpyByte Engineering

Published

Reading time

2 min read

On 16 November we needed this year's monthly report files from a client's Windows server for an import we were building. The folder was dragged out of a Remote Desktop session, in Microsoft's Windows App on a Mac, onto the Mac's desktop. The copy finished.

Then the import could not read most of the files. They would not open as spreadsheets at all.

What was wrong with the files

  • The names and sizes were right. In Finder, each file showed a normal size.
  • Only the first 262,144 bytes held data. That is exactly 256 KB. Every byte after it was zero.
  • Small files were fine. Anything under 256 KB arrived whole, so a quick spot check of a few files looked fine.
  • It hit most of the large ones: 91 of the 133 spreadsheets in the folder, and most of the PDFs.

Because the size was right, nothing looked wrong until a program tried to read past the first 256 KB. We did not find why the client did this. What matters is that it happened without any warning.

How to check a copy

The reliable check is a checksum: a short fingerprint of the file's contents. If the fingerprint on the server and on your computer match, the copy is identical. If one byte differs, it will not match.

# On the Windows server (PowerShell)
Get-FileHash .\report.xlsx -Algorithm SHA256

# On the Mac (Terminal)
shasum -a 256 report.xlsx

# Quick test on the Mac: a whole .xlsx is a zip, so this reports damage
unzip -tq report.xlsx

For a whole folder, compare the list of checksums from both sides. The files that differ are the ones to copy again.

Safer ways to move files out of a server

  1. Zip the folder on the server first, then copy the single zip. A cut zip fails to open at once instead of failing later, file by file.
  2. Use a shared drive or cloud storage the server and your computer both reach, such as OneDrive, SharePoint or a company file share, rather than dragging through the session.
  3. Use a redirected drive in the Remote Desktop client settings for larger folders, and still check the checksums.
  4. Check before you use the files, every time it matters: payroll, tax and accounting data especially.

The short version

A finished copy with the right file sizes is not proof the files are whole. Copy large folders as one zip, compare checksums when the data matters, and test files before importing them. If you need imports or file transfers that check themselves, tell us what you move and where.

Written by

CrpyByte EngineeringEngineering team

The team that designs and builds CrpyByte client systems and tools. We write about the parts of the work worth writing down.

Have a process worth improving?

Let's build the system behind it. Tell us what the process is and where it breaks — the first conversation is about constraints, not technology.