× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

yes I have had the same problem, e.g. when creating CSV files on the fly and
needs

Content-type: application/vnd.ms-excel
Content-disposition: attachment; filename=PXWATBL.csv

..... some CSV data .....

In powerEXT Core API (that runs on top of a CGIDEV2 implementation) there is
2 ways to handle it:

1. Save the output buffer size after creating the MIME header, create the
data and then use
the build in convCCS procedure to convert the rest of the buffer (the MIME
header must be
in EBCDIC):

setContent('*none');
echo('Content-type: application/vnd.ms-excel');
echo('Content-disposition: attachment; filename=PXWATBL.csv');
echo('');
savedSize = bufSize();
..... create CSV (or XML) datarecords .....
convCCS(bufAddr()+savedSize:bufSize()-savedSize:0:819);

(bufAddr and bufSize gives the current addr/size of CGIDEV2 output buffer.

2. Create the CSV file raw and save it in a temporary IFS-file in the
correct CCSid and then use the build in procedure to send the file
as binary to the Client.

setContent('*none');
..... create CSV (or XML) datarecords ....
echoToStmf('/myworkfile.csv':819);
echoBinToClient('application/vnd.ms-excel':'/myworkfile.csv':'myworkfile.csv');


I have the same problem with certain applications that may expect either
CCS 819 (typical MS) or 1208 (typical XML) but accepts text-type MIME
headers.
If the Apache server is set to convert to the opposite (819/1208) things
goes wrong.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.