How to download a text file from another URL within Wt.

Added by Rathnadhar K V 4 months ago

Namaskara,

I need to download a stock exchange data from Bombay Stock Exchange site. I can programatically generate the following url: https://www.bseindia.com/download/BhavCopy/Equity/EQ<date>_CSV.ZIP

It downloads a .zip file. On days where there is no trading, then there will be no file we will get 404 error.

I need to store this file to a particular directory.

How to do it....I see examples where the file from local site is downloaded, but i need the file from 3rd party site to get downloaded.

Please help.

Regards
Rathnadhar K V


Replies (3)

RE: How to download a text file from another URL within Wt. - Added by Rathnadhar K V 4 months ago

I am using CURL now, need to get away from it. Its too slow.

https://www.bseindia.com/download/BhavCopy/Equity/EQ<<date>>_CSV.ZIP

RE: How to download a text file from another URL within Wt. - Added by Rathnadhar K V 3 months ago

Namaskara,

I used lftp to download the files, with success. CURL was too slow.

But I am still looking for solution within wt, is it possible to do that?

Regards
Rathnadhar K V

RE: How to download a text file from another URL within Wt. - Added by lm at 3 months ago

I think you'll be looking for Wt::WFileResource: https://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WFileResource.html. With this class, you can configure your application to serve a file at certain URLs.

(1-3/3)