Nani
Nani

Reputation: 1176

How to provide file download feature in a Wt based web application?

I have a web application developed using Wt framework in C++. I have some files on local disc and I want to provide file downloading functionality in my web application. Anyone's help through this will be helpful. Thank you!

Upvotes: 0

Views: 245

Answers (1)

m7913d
m7913d

Reputation: 11072

Two methods exists two provide access to static files:

  • Specifying the docroot location (= folder containing the static files) as a command line argument. See the Wt: Library overview for more information. This approach is mostly used for images, css files, ...
  • Using a Wt::WResource (or f.ex. the specialised Wt::WFileResource). Advantage of this approach is that you could limit the access to those (static) resources to specific users only. This approach could also be used to download on the fly generated resources.

Upvotes: 0

Related Questions