Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Reading a file online

I need to read a sequence of bytes stored in a basic txt file which can be found at a specific url. With a local file path I can use SaveFileToArray() function to store the bytes in a uint8 array, how can I do the same with the given file url?

Product Version: UE 4.9
more ▼

asked Oct 29 '15 at 03:48 PM in C++ Programming

avatar image

125 11 19 129

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Fact that you can use http urls as files is a extra feature to make things comfitible, but in code they are 2 separate data channels with diffrent APIs.

UE4 has module to talk to HTTP server:


This is entry point:


Create a http request:


I returns request body which you can edit with those functions:


Request is processed asynchronously so it does not lock the thread waiting for response from server, thats why you need to bind event which be called when responce been recived:


Once you set up the request you call ProcessRequest and HTTP module with do the rest:


And once it got reponce it will call function you binded with IHttpReponce argument from which you can read reponce data:

https://docs.unrealengine.com/latest/INT/API/Runtime/HTTP/Interfaces/IHttpBase/index.html https://docs.unrealengine.com/latest/INT/API/Runtime/HTTP/Interfaces/IHttpResponse/index.html

Here you have nice simple example from engine source code how to use it (Note how OnProcessRequestComplete function arguments, your function needs to be exactly the same, only name can be different):


If you don't know how HTTP works (which if you ever worked with PHP and web devlopment you should know) then learn about it because it will be very useful here:


And lastly if you gonna use HTTP module, remember to add "HTTP" in to depency in build scipt same as you do with "AIModule", otherwise you gonna have linker errors

more ▼

answered Oct 29 '15 at 04:43 PM

avatar image

37.3k 936 172 1116

avatar image Vahid Jan 18 '17 at 07:31 AM

Hello, Thanks for your description, I've a question: I'm trying to add support for external login for my App (I'm trying to add WeChat QR scan login) It totally use the URL to handle process, I can show the QR code in UE web browser and i can login successfully but the login is totally in that browser, I need to login outside of browser too, do you have any suggestion how i can do that ? (Now i can manually login to my server with username & password with json and POST verb)... Thank you

avatar image Shadowriver Jan 26 '17 at 01:02 AM

You know how cookie sessions work right? Somehow you need to catch the session id and use it with HTTP to by sending cookie (first learn how cookies works). Noe here the problem, it seem theren ot really way to get a cookie from web browser widget, you would need to get some session key with diffrent method, liek sending key somehow and catcxh it web browser event and use it later in HTTP. Best sollution would be if you use login without using web browser.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question