Categories > TinyButStrong general >

Problem download html file

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: miki89
Date: 2015-08-26
Time: 19:21

Problem download html file

Hi to everybody,
I have a problem with TBS. I need to create an html document and download that. I use this script but it only shows the html text but no download the file. I use OPENTBS_FILE but it doesn't work too but they work when i create a word page.

include_once('../tbs_us/tbs_class.php');
include_once('../tbs_us/plugins/tbs_plugin_opentbs.php');
$TBS = new clsTinyButStrong;
global $message;
$message='<p>hi to everybody</p>';

$out = 'document.html';
$TBS->LoadTemplate('../doc/html_template.html');
$TBS->Show(OPENTBS_DOWNLOAD,$out);

And this is the template:

<html>
  <body>
    [onshow.message;strconv=no]
  </body>
</html>

Thanks and regards.
By: Skrol29
Date: 2015-08-26
Time: 23:30

Re: Problem download html file

Hi Miki89

OpenTBS cannot manage HTML files. It is done to manage binary files that are in fact a zip archive. That is the case with Ms Office and Libre Office documents.

In order to make a download with you HTML result then you have to use TBS alone, and ends the merging with $TBS->Show(TBS_NOTHING)
Then you have to perform an HTML download using PHP, the result of the merge is given by the property $TBS->Source