Assigning something to the "asText" property (or any other "as..." property) only makes it available locally (for example, from inside local events), but ... it is NOT sent to the other side. WebSocket frames ONLY contain an "Opcode" (wf_Text, wf_Binary, wf_Ping, ...) and an optional "Payload" (raw data), which means that ANYTHING you want to send to the other side (with the exception of the opcode, which can ONLY be used to define the type of the frame) has to be sent as part of the "Payload" data.
In other words, if you wanted to send the name of the file to the other side, you would either have to include that file name as part of your "payload" data, or ... send the file name in a separate frame. How you do it is entirely up to you, but make sure the receiver knows what to expect and how to separate that information.
PS. There are also 3 additional bit-size flags in WebSocket Frames (accessible using the waRSV1, waRSV2 and waRSV3 properties on TRtcWSFrame objects), but these flags are reserved for WebSocket Extensions and should NOT be used at the Application level, unless you are implementing a WebSocket Extension. There is also the "Final" flag (waFinal property), which can be used to send multiple frames containing a single combined payload (see the example where "Text" is being sent in chunks), but ... since Clients could automatically combine continuation frames into a single payload (most WebBrowsers do this automatically), I wouldn't recommend using continuation frames as a way to separate your payload into "logical units" (for example, the first frame containing the file name, with continuation frames containing raw file data). Here is the complete WebSocket specification, it you want more details:
https://tools.ietf.org/html/rfc6455Best Regards,
Danijel Tkalcec