× 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.



Mel,

1) Bingo! Apparently the lack of a CRLF (x'0d25') after the 'Content-type'
header masked the 'Content-Disposition' header from the browser. Thanks!

2) The data is still corrupted, though, and I may need to play with the
'charset' parameter, or even learn how to use that EBCDIC-ASCII translation
API.

3) I've previously downloaded and studied the excellent CGIDEV2 library, but
until recently had not had an application for it. That's fixin' to change
though, so thanks for giving it to all of us.

4) BTW - this entire exercise has been driven by my inability to make the
browser recognize either the 'title=' or the 'filename=' param on an '<a
href=>' tag. i.e.: the following makes the browser want to save the file as
'0545865_001.zip' instead of 'meaningfulfilename.zip'. Any suggestions? 

<td><a href="/documents/0545865_001.zip"
title="meaningfulfilename.zip">view</a></td>

JK

> -----Original Message-----
> From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-
> bounces@xxxxxxxxxxxx] On Behalf Of Mel Rothman
> Sent: Friday, July 15, 2005 2:48 PM
> To: midrange-l@xxxxxxxxxxxx
> Subject: Re: RPG, CGI and Content-Disposition
> 
> My first suggestion is that you read Scott's third CGI article, the one
> that
> about CGIDEV2. Here is a link: http://makeashorterlink.com/?A1536507B
> 
> In the meantime, change the definition of CRLF from x'0d25' to x'15'.
> 
> Then insert a CRLF between the two response headers.
> 
> I have not verified that the response headers are correct for your
> purposes, but
> you should get closer to your goal with these changes.
> 
> Mel Rothman, CGIDEV2 Author
> Mel Rothman, Inc.
> 
> JK wrote:
> > Hello all,
> >
> >  I need to enhance our web-based document retrieval system. It seems
> that a
> > cgi program would do the trick but I'm having a dickens of a time
> getting
> > things to behave. If this is not too off-topic perhaps someone could
> point
> > me in the right direction?
> >
> >  The following code (swiped from Scott K's recent article, thanks Scott)
> has
> > two problems:
> > 1) The browser (both IE6 and Firefox) wants to save the file as
> > 'sendfile.pgm' instead of 'report.csv'. I've tried various permutations
> of
> > the Content-Disposition and filename params but nothing convinces the
> > browser that it should do anything differently. See:
> > http://www.faqs.org/rfcs/rfc2183
> >
> > 2) The data written to the PC is hieroglyphic gibberish. I assume the
> text
> > needs to be translated from EBCDIC to ASCII before calling QtmhWrStout?
> >
> > D QtmhWrStout     PR                  extproc('QtmhWrStout')
> > D   DtaVar                   32767A   options(*varsize) const
> > D   DtaVarLen                   10I 0 const
> > D   ErrorCode                 8000A   options(*varsize)
> > D ErrCode         ds                  qualified
> > D   BytesProv                   10I 0 inz(0)
> > D   BytesAvail                  10I 0
> > D CRLF            c                   x'0d25'
> > D data            s           1000A   varying
> > /free
> >     data = 'Content-type: application/x-download' +
> >            'Content-Disposition:attachment;filename="report.csv"' +
> >            CRLF + CRLF;
> >     QtmhWrStout(data: %len(data): ErrCode);
> >     data = 'This is the first record' + CRLF;
> >     QtmhWrStout(data: %len(data): ErrCode);
> >     data = 'This is the 2nd record' + CRLF;
> >     QtmhWrStout(data: %len(data): ErrCode);
> >     return;
> >  /end-free
> >
> > Many thanks, JK


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.