EFMDownloader
HTTP file downloading with progress tracking, speed monitoring, and multiple output modes.
Delegates
FOnDownloadProgress
DECLARE_DYNAMIC_DELEGATE_ThreeParams(FOnDownloadProgress, const FString&, URL, float, ProgressPercent, int64, BytesDownloaded)
FOnDownloadComplete
DECLARE_DYNAMIC_DELEGATE_ThreeParams(FOnDownloadComplete, bool, bSuccess, const FString&, URL, const FString&, SavedPath)
FOnDownloadCompleteMemory
DECLARE_DYNAMIC_DELEGATE_ThreeParams(FOnDownloadCompleteMemory, bool, bSuccess, const FString&, URL, const TArray<uint8>&, Data)
FOnDownloadJSONComplete
DECLARE_DYNAMIC_DELEGATE_ThreeParams(FOnDownloadJSONComplete, bool, bSuccess, const FString&, URL, const FString&, JSONString)
FOnGetFileSizeComplete
DECLARE_DYNAMIC_DELEGATE_ThreeParams(FOnGetFileSizeComplete, bool, bSuccess, const FString&, URL, int64, FileSize)
Functions
DownloadFile
Callable Downloads a file from a URL to disk.
C++
void DownloadFile(UObject* WorldContextObject, const FString& URL, const FString& SavePath,
FOnDownloadProgress OnProgress, FOnDownloadComplete OnComplete)
| Parameter | Type | Description |
|---|---|---|
WorldContextObject | UObject* | World context |
URL | FString | URL to download from |
SavePath | FString | Full path to save the downloaded file |
OnProgress | FOnDownloadProgress | Progress callback (URL, percent, bytes) |
OnComplete | FOnDownloadComplete | Completion callback |
Category: EFM|Download
Blueprint Node
ƒDownload File
URL
Save Path
On Progress
On Complete
DownloadFileToMemory
Callable Downloads a file into memory.
C++
void DownloadFileToMemory(UObject* WorldContextObject, const FString& URL,
FOnDownloadProgress OnProgress, FOnDownloadCompleteMemory OnComplete)
Category: EFM|Download
Blueprint Node
ƒDownload File To Memory
URL
On Progress
On Complete
DownloadJSON
Callable Downloads and returns JSON string.
C++
void DownloadJSON(UObject* WorldContextObject, const FString& URL,
FOnDownloadProgress OnProgress, FOnDownloadJSONComplete OnComplete)
Category: EFM|Download
Blueprint Node
ƒDownload JSON
URL
On Progress
On Complete
CancelDownload
Callable Cancels an active download.
C++
void CancelDownload(const FString& URL)
Category: EFM|Download
Blueprint Node
ƒCancel Download
URL
IsDownloading
Pure Checks if a URL is currently being downloaded.
C++
bool IsDownloading(const FString& URL)
Category: EFM|Download
Blueprint Node
ƒIs Downloading
URL
Return Value
GetDownloadSpeed
Pure Gets the current download speed for a URL.
C++
float GetDownloadSpeed(const FString& URL)
Returns: Download speed (bytes/second)
Category: EFM|Download
Blueprint Node
ƒGet Download Speed
URL
Return Value
GetRemoteFileSize
Callable Gets the size of a remote file without downloading it.
C++
void GetRemoteFileSize(UObject* WorldContextObject, const FString& URL, FOnGetFileSizeComplete OnComplete)
Category: EFM|Download
Blueprint Node
ƒGet Remote File Size
URL
On Complete
Example
// Download with progress
DownloadFile(
Self,
"https://example.com/config.json",
GetGameSavedDirectory() + "config.json",
OnProgress(URL, ProgressPercent, BytesDownloadged):
UpdateProgressBar(ProgressPercent)
Log("Downloaded: " + BytesDownloadged + " bytes"),
OnComplete(bSuccess, URL, SavedPath):
if bSuccess:
Log("Saved to: " + SavedPath)
else:
LogError("Download failed")
)
// Check if downloading
if IsDownloading("https://example.com/config.json"):
Speed = GetDownloadSpeed("https://example.com/config.json")
Log("Speed: " + Speed + " bytes/s")
// Get remote file size first
GetRemoteFileSize(Self, "https://example.com/largefile.zip", OnComplete)
OnComplete(bSuccess, URL, FileSize):
Log("Remote file size: " + FileSize + " bytes")