Project

General

Profile

Download link without a widget

Added by Mario Hegele about 6 years ago

Hi everybody,

I would like to create a download link on my website that allows to download a resource (a file) without creating a button or similar.

The file is not located in docroot but somewhere on my file system.

It shall be downloadable via an address like 'http://mywebsite.com/myfile.txt

With WFileResource, WLink and WAnchor I can create a download link which allows a user to interactively download the file with a browser.

But how can I create a link which can be used by another application?

What am i missing?

Yours

Mario


Replies (2)

RE: Download link without a widget - Added by Roel Standaert about 6 years ago

If you want to expose a static resource, you can add it to the WServer, so instead of using WRun, you can also create a WServer and add your application as an entrypoint, see: https://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WServer.html#details

You can then use addResource to add a WFileResource.

Regards,

Roel

RE: Download link without a widget - Added by Mario Hegele about 6 years ago

Thank you,

"addResource" did the trick.

Regards,

Mario

    (1-2/2)