Categories > OpenTBS with DOCX >

Forward to new page after OPENTBS_DOWNLOAD

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Chris
Date: 2013-08-06
Time: 13:33

Forward to new page after OPENTBS_DOWNLOAD

I've got my template and script working, ending with "$TBS->Show(OPENTBS_DOWNLOAD, 'sample.docx');". My issue is, I now want some of the information calculated in this page, to be displayed on a new page the user is then forwarded to, after download

Anything I echo after this line only corrupts my docx, or is ignored. I've tried various combinations of OPENTBS_DOWNLOAD + TBS_OUTPUT and other options, all with no luck. Do I need to reset the output line or something - can anyone who knows the library better point my in the right direction?

Thanks.
By: Sarah Kemp
Date: 2013-08-06
Time: 17:24

Re: Forward to new page after OPENTBS_DOWNLOAD

You could save the document on your server ($TBS->Show(OPENTBS_FILE, $file_name);) and provide a link to download it rather than forcing the download. You can then echo whatever you want.
By: Chris
Date: 2013-08-09
Time: 13:02

Re: Forward to new page after OPENTBS_DOWNLOAD

Thanks, I guess that's a valid solution, although I would then need to regularly delete the files, which was the advantage of OPENTBS_DOWNLOAD.

If that's the best way around it, I guess I'll run with that though. Cheers!
By: Sarah Kemp
Date: 2013-08-09
Time: 16:43

Re: Forward to new page after OPENTBS_DOWNLOAD

If you don't have high traffic you could always save the file under the same name each time. You wouldn't have to worry about the space used then. Or just rotate through the same 10 file names or something. You could just write your script so it checks for past files before it saves and deletes them. Lots of options.
By: Chris
Date: 2013-08-12
Time: 15:55

Re: Forward to new page after OPENTBS_DOWNLOAD

Very true, didn't really think that one through. :P Thanks!