Verify that your Content-Length isn’t 0


Also, encoding=multiline will change the number of bytes of the variable, so 
make sure you are measuring it correctly.



Most web servers will add the Content-Length header automatically, so you might 
want to try removing it as well.



Lastly, try placing a space after the : in each header.



Here’s some live code that I use for an excel file:



<@ASSIGN request$httpheader 'HTTP/1.1 <@HTTPSTATUSCODE> 
<@HTTPREASONPHRASE><@CRLF>Content-Type: 
application/vnd.ms-excel<@CRLF>Content-Disposition: attachment; 
filename="filename.xls"<@CRLF>Last-Modified: <@CURRENTTIMESTAMP 
format=datetime:http><@CRLF><@CRLF>'><@PURGERESULTS>@@user$exceldownload



From: Reeve, Lawrence D. (ARC-IO)[ASRC RESEARCH & TECHNOLOGY SOLUTIONS] 
[mailto:lawrence.d.re...@nasa.gov]
Sent: Friday, April 14, 2017 7:57 AM
To: TeraScript-Talk@terascript.com
Subject: TeraScript-Talk: XML File header



Does anyone have an example of terascript header to output an xml file (as a 
downloaded file, not to the browser). I used to use the following in times past 
but it no longer seems to work with Terascript 7.

                                                                           



<@EXCLUDE><@ASSIGN request$DebugMode "ForceOff">

<@ASSIGN request$httpHeader "HTTP/1.0 200 OK<@CRLF>Server: Witango 
5.0.1.062<@CRLF>Content-Type:text/xml<@CRLF>Content-Disposition:attachment; 
filename=File<@CURRENTTIMESTAMP>.txt<@CRLF>Charset:UTF-8<@CRLF>Content-Length:<@VAR
 request$LengthXmlOutputFileTest><@CRLF><@CRLF>">

<@ASSIGN request$encodeResults FALSE>

<@PURGERESULTS>

</@EXCLUDE><@VAR request$xmlOutputFileTest encoding=mulitlinehtml>







I’ve tried Content-Type:application/octet-stream and some other variations but 
it always results in zero bytes size files.





The content of the file I am trying to putput is:



<FORMDATA>

                <VERSION>1.1</VERSION>

                <FORMLOC>C:\Cerenade\ESDOTNET\forms\1.41</FORMLOC>

                <FORMVERSION>1.41</FORMVERSION>

                <FIELDDATA>

                                <field name="ReleaseNo">88</field>

                                <field name="DataRecNo">18979</field>

                                <field name="TrackNo">28155</field>

                                <field name="STINo">25477</field>

                                <field name="Center">GSFC</field>

                                <field name="OrgCode">660</field>

                                <field name="Title">THE TRANSIENT ACCRETING 
X-RAY PULSAR XTE J1946274:STABILITY OF THE X-RAY PROPERTIES AT LOW FLUX AND 
UPDATED ORBITAL SOLUTION</field>

                                <field name="PAuthor">diana.m.ma...@nasa.gov 
<mailto:diana.m.ma...@nasa.gov%3c/field> </field>

                                <field name="STISubType">05</field>

                                <field name="VenueName">The Astrophysical 
Journal</field>

                                <field name="VenueSponsor">IOP 
Publishing</field>

                                <field name="VenueLocation">Vol. 1 ; No. 
1</field>

                                <field 
name="VenueURL">http://adsabs.harvard.edu/abs/2015arXiv151005032M 
<http://adsabs.harvard.edu/abs/2015arXiv151005032M%3c/field> </field>

                                <field name="VenueDate">01/23/2015</field>

                                <field name="Citation">M, Marcu, Diana.; , 
Pottschmidt, Katja.; , Kuhnel, Matthias.; , Muller, Sebastian.; , Falkner, 
Sebastian.; , Caballero, Isabel.; H, Finger, Mark.; Alexander, Jenke, Peter.; 
A., Wilson-Hodge, Colleen.; , Furst,Felix; , Grinberg, Victoria.; B., Hemphill, 
Paul.; , Kreykenbohm, Ingo.; , Klochkov, Dmitry.; E, ROTHSCHILD, RICHARD.; , 
Terada, Yukikatsu.; , Enoto, Teruaki.; , Iwakiri, Wataru.; T., Wolff, Michael.; 
L, Becker, Perry.; Sebastian, Wood, Kent.; , Wilms, Jorn.:  <i>THE TRANSIENT 
ACCRETING X-RAY PULSAR XTE J1946274:STABILITY OF THE X-RAY PROPERTIES AT LOW 
FLUX AND UPDATED ORBITAL SOLUTION.</i> - 05 Journal Article - 01/23/2015 - Vol. 
1 ; No. 1</field>

                                <field name="OrAuthDissemNo">3</field>

                                <field name="ProcessAs">5</field>

                                <field 
name="AddEmail">lawrence.d.re...@nasa.gov 
<mailto:lawrence.d.re...@nasa.gov%3c/field> </field>

                                <field name="AddDate">04/11/2017 
00:00:00</field>

                                <field 
name="ApproverEmail">lawrence.d.re...@nasa.gov 
<mailto:lawrence.d.re...@nasa.gov%3c/field> </field>

                                <field name="ApproveDate">04/12/2017 
12:38:13</field>

                                <field name="ReleaseStatus">4</field>

                                <field 
name="PMCReviewerEmail">kevin.boyds...@nasa.gov 
<mailto:kevin.boyds...@nasa.gov%3c/field> </field>

                                <field name="FundingSource">NNA1234567</field>

                                <field name="Comment">comment</field>

                </FIELDDATA>

                <attachments>

                                <attachment encoding="base64" 
DocRecNo="610781.pdf"></attachment>

                </attachments>

</FORMDATA>



From: Robert Shubert <rshub...@tronics.com <mailto:rshub...@tronics.com> > on 
behalf of Robert Shubert <rshub...@tronics.com <mailto:rshub...@tronics.com> >
Reply-To: "TeraScript-Talk@terascript.com 
<mailto:TeraScript-Talk@terascript.com> " <TeraScript-Talk@terascript.com 
<mailto:TeraScript-Talk@terascript.com> >
Date: Thursday, January 26, 2017 at 8:27 AM
To: "TeraScript-Talk@terascript.com <mailto:TeraScript-Talk@terascript.com> " 
<TeraScript-Talk@terascript.com <mailto:TeraScript-Talk@terascript.com> >
Subject: TeraScript-Talk: setting up TS8



All:



There’s a webpage here: https://www.terascript.com/8



With a few notes about getting v8 running.



It’s specific to Windows, but OSX is very similar – just different paths, and 
the install/control scripts.



Robert



  _____

To unsubscribe from this list, please send an email to lists...@terascript.com 
<mailto:lists...@terascript.com>  with "unsubscribe terascript-talk" in the 
body.



  _____

To unsubscribe from this list, please send an email to lists...@terascript.com 
<mailto:lists...@terascript.com>  with "unsubscribe terascript-talk" in the 
body.




----------------------------------------

To unsubscribe from this list, please send an email to lists...@terascript.com 
with "unsubscribe terascript-talk" in the body.
  • Tera... Reeve, Lawrence D. (ARC-IO)[ASRC RESEARCH & TECHNOLOGY SOLUTIONS]
    • ... Robert Shubert

Reply via email to