What this guide does
Send a local workbook to an RDP session and retrieve an unchanged copy. You will check transfer completion and SHA-256, then use the same workflow to bring back a file saved by a remote application. These steps use the rdp-cli 0.1.0 command interface and the verified file workflow from 21 September 2026; they are a reproduction guide, not a new test run.
Prepare the session and sample
Install the appropriate download, then use the quick start to connect to an authorized Windows RDP server. Save the returned data.session and replace SESSION below. The server must allow drive redirection and your caller must have file permission. VNC does not provide this exchange drive.
Each session has its own exchange directory. --path is relative to that directory: it is not an arbitrary Windows path such as C:\Users\.... The remote application sees the directory as a redirected drive. CLI file operations do not require a viewer or human keyboard control.
Save the sample workbook in your current local directory as service-activity.xlsx (4,489 bytes). It contains 12 months of fictional service data. Examples use rdp-cli on PATH. On Windows, run from the EXE folder and substitute .\rdp-cli.exe; on Linux, use the installed command or ./rdp-cli-linux-x86_64 / ./rdp-cli-linux-arm64.
rdp-cli status --session SESSION
rdp-cli files list --session SESSION
Check the connected session, negotiated capabilities and the listing response. If file access is unavailable, correct the server policy or authorization before proceeding.
Upload and wait for completion
rdp-cli files upload --session SESSION --local ./service-activity.xlsx --path service-activity.xlsx
A successful start can return data.state: queued and data.transfer_id. Save that ID as TRANSFER_ID; acceptance is not completion.
rdp-cli files status --session SESSION --transfer-id TRANSFER_ID
In the status response, read data.state, compare data.bytes_transferred with data.total_bytes, and check the completed file digest in data.files[].sha256.
Repeat the status query until it reports a terminal state. Continue only with completed, the expected 4,489 bytes and the file digest. The remote application can then open the workbook from the session's redirected drive. Do not infer success merely because a filename is visible.
Download and verify the returned bytes
Leave the workbook unchanged for this first round trip:
rdp-cli files download --session SESSION --path service-activity.xlsx --local ./service-activity-returned.xlsx
This download has its own data.transfer_id. Query it with files status as above, using the new ID. After completed, the local result is service-activity-returned.xlsx. Compare both files on macOS:
shasum -a 256 ./service-activity.xlsx ./service-activity-returned.xlsx
On Linux:
sha256sum ./service-activity.xlsx ./service-activity-returned.xlsx
On Windows PowerShell:
Get-FileHash -Algorithm SHA256 .\service-activity.xlsx, .\service-activity-returned.xlsx
Both hashes should be 1869e5708fe8922a99ff3efee1c0d285df3dd94588d59f5ad48f282db915df51. If you edited the workbook remotely, matching the original is no longer expected: save the result to the exchange drive, download that result path and verify its content instead.
Transfer a whole folder
Create a local folder named source-folder containing the files you intend to send:
rdp-cli files upload --session SESSION --local ./source-folder --path source-folder
Wait for that upload to complete before downloading:
rdp-cli files download --session SESSION --path source-folder --local ./received-folder
Query each transfer separately. Empty directories and the tree structure are preserved; ./received-folder is the exact destination root. A directory transfer publishes completed files individually, so partial or cancellation can leave completed files behind. It is not one atomic transaction for the entire tree.
Recover without repeating an unknown transfer
- Destination already exists: choose another path, or add
--overwriteonly when replacing that destination is intended. Replacement is not the default. FILE_BUSY: finish saving or exporting in the remote application, then inspect the file and transfer state before retrying.- Lost start response: query
rdp-cli files status --session SESSIONto inspect known transfers. Do not immediately repeat an upload or overwrite whose result is unknown. failed,partialorcancelled: inspect the per-file result and cause; completed files may remain. Disconnecting or losing file permission can stop active work. A new connection does not silently resume it.- Invalid path: use forward-slash exchange-relative paths. Absolute paths,
.., unsafe links and conflicting names are rejected.
To stop a known transfer, use its actual ID and check the resulting status:
rdp-cli files cancel --session SESSION --transfer-id TRANSFER_ID
Pausing desktop input does not cancel file transfers. A completed transfer proves the bytes were copied; it does not prove the remote application produced the right report.
Continue with a verified remote result
The LibreOffice Calc case uses the same upload → remote editing → download workflow. It includes the actual saved report, original screenshot, formulas and verified totals. Consult the file feature and protocol limits before using the workflow in another environment.