Categories > OpenTBS general >

Download and Save File as backup

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: ihsan
Date: 2011-11-03
Time: 04:00

Download and Save File as backup

Hi, i would like to make user download the created file from TBS, and make TBS save the file created as backup..

So for i did like this :

$TBS->Show(OPENTBS_DOWNLOAD,$name);
$TBS->Show(OPENTBS_FILE+TBS_EXIT, $pathDuplicate);

The file for download when open working correctly but for file that save for backup is not working..the file is corrupted.
I use TBS to generate Ms Office.

am i doing it wrong way..?

Thanks in advance.

Ihsan
By: Skrol29
Date: 2011-11-03
Time: 14:33

Re: Download and Save File as backup

Hi Ihsan,

It is not correct to do Show() twice on a merged document.
You have to do
$TBS->Show(OPENTBS_DOWNLOAD,$name);
And then code yourself the HTTP headers that will make the download of the saved file. You can see the OpenTBS code snippet that does the HTTP headers.
By: ihsan
Date: 2011-11-04
Time: 01:21

Re: Download and Save File as backup

Thank for replying, it's work..