Generic file transfer from UE to Frontend

This feature enables a seamless bridge between your Unreal Engine application and the Web Browser (Frontend).

While primarily used for capturing and downloading screenshots, this blueprint logic provides a generic framework to transfer any file generated by the engine during a Pixel Streaming session directly to the end-user's local machine.

Feature Overview

The Generic File Transfer system leverages Arcware’s custom communication layer to send binary data or file paths from the Unreal Engine instance to the browser.

  • How it works: The engine generates a file (e.g., a .png, .pdf, or .txt), identifies its location on the server, reads the data, and triggers a "Pixel Streaming Response."

  • Key Advantage: It bypasses the need for external cloud storage or complex FTP setups for simple file handoffs, providing an immediate "Save As" experience for the user.

Blueprint Breakdown

The logic in the provided screenshot follows a linear flow: Path Construction → Action Execution → File Loading → Frontend Notification.

1. Set File Path Function

Before a file can be sent, the engine must define exactly where it is being stored.

  • Logic: The blueprint uses Append nodes to combine the Project Saved Directory with a specific folder name (e.g., /Screenshots/) and a dynamic filename.

  • Flexibility: You can modify the string inputs here to point to any directory within your project’s write-accessible folders.

2. Execute Console Command (Screenshot Capture)

In this specific implementation, the flow triggers the engine's internal command to capture the viewport.

  • Node: Execute Console Command.

  • Command: Uses the file path generated in the previous step.

  • Delay: A short Delay node (e.g., 0.2s) is often included to ensure the engine has finished writing the file to the disk before the next node attempts to read it.

3. Load & Read File

Once the file exists on the server's drive, it needs to be converted into a format the web browser can handle.

  • Read File: The blueprint retrieves the file from the "Saved" path.

  • Data Handling: The data is processed into a byte array or a format compatible with the Pixel Streaming communication component.

4. Send Pixel Streaming Response

This is the final "Handshake" with the Arcware Frontend.

  • JSON Construction: The logic builds a JSON object containing a type (e.g., "Screenshot") and the file data/URL.

  • Send Response: The Send Pixel Streaming Response node broadcasts this message. The Arcware Frontend sees this "Notice," identifies the file, and triggers the browser's download prompt.

Extending the Functionality

Because this is a Generic setup, you can replace the "Screenshot" logic with any other file-generating event:

File Type

UE Source Action

Use Case

.txt / .json

Save String to File

Exporting user configuration or high scores.

.csv

Export Data Table

Exporting analytics or product lists from a configurator.

.png / .jpg

Render Target Export

Saving custom textures or UI snapshots.

circle-info

Note: Always ensure the Delay node is sufficient for the file size being generated. Large files may require a "Success" callback rather than a static timer to prevent the "File Not Found" error during transfer.

Last updated