Project

General

Profile

Creating file from char array

Added by egor bayanov about 5 years ago

Greetings

In my application, when changing internal paths, the URL is parsed. Can I create images or other files "on the fly" from an char array with certain URLs. And if possible, how?

I found mentioning that this can be done using WResource, but did not understand how

thank


Replies (1)

RE: Creating file from char array - Added by Wim Dumon about 5 years ago

Hello Egor,

look at the API of WMemoryResource, or at the implementation of WMemoryResource. A WResource has a URL, and when that URL is accessed, the resource's handleRequest() method is invoked, which is responsible for producing the data to be sent in response to the request. Anchors (WAnchor), images (WImage), etc can point to a WResource instead of to a plain file to obtain their data.

Best regards,

Wim.

    (1-1/1)