- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Apache Content-Type for PDF
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2005 09:13 PM
тАО08-29-2005 09:13 PM
I'm trying to output a PDF file through Apache using the DCL code below, but the file is just displayed as text to the browser (MSIE) rather than being launched in Acrobat.
Any ideas how I can make this work?
Rob.
$ !
$ WS F$FAO("!AS!/!/","Content-type: application/pdf")
$ WS ""
$ !
$ TYPE WEBREPORT$STORE:ALPD_20040729_3F9B.PDF;1
$ !
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2005 10:05 PM
тАО08-29-2005 10:05 PM
Re: Apache Content-Type for PDF
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-29-2005 10:21 PM
тАО08-29-2005 10:21 PM
Re: Apache Content-Type for PDF
The code currently loads the file as http://server/webreports/store/filename.pdf, but I want to make the system more secure by hiding the filename and accessing it using some kind of session generated alias.
Rob.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2005 05:06 AM
тАО08-30-2005 05:06 AM
Re: Apache Content-Type for PDF
Try loading the URL in a different browser to see if this is the case.
If so, then you will need to include the .PDF file type to keep MSIE happy.
You may be able to get away with adding a query string to the URL, e.g. something like
http://server/whatever.ext?type=.pdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2005 05:40 AM
тАО08-30-2005 05:40 AM
Re: Apache Content-Type for PDF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2005 06:46 PM
тАО08-30-2005 06:46 PM
Re: Apache Content-Type for PDF
TYPE will look at the file as an ASCII file and will not do any interpretation so you will see the text as it is. Try typing a PS file and you'll see the same type of output.
To read the file on VMS, you need the reader.
To read it via Apache, I think what you need to do is defining a mime.type line in apache$root:[conf]httpd.conf for PDF, something like:
AddType application/x-acroread .pdf
but I'm not sure what to specify in this case.
Willem
OpenVMS Developer & System Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2005 06:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-30-2005 07:43 PM
тАО08-30-2005 07:43 PM
Re: Apache Content-Type for PDF
The final solution looks something like this :-
$ APACHE$DCL_BIN := $ APACHE$ROOT:[000000]APACHE$DCL_BIN.EXE_'F$GETSYI("ARCH_NAME")'
$ APACHE$DCL_ENV := $ APACHE$ROOT:[000000]APACHE$DCL_ENV.EXE_'F$GETSYI("ARCH_NAME")'
$ APACHE$DCL_RUN := $ APACHE$ROOT:[000000]APACHE$DCL_RUN.EXE_'F$GETSYI("ARCH_NAME")'
$ APACHE$FLIP_CCL:= $ APACHE$ROOT:[000000]APACHE$FLIP_CCL.EXE_'F$GETSYI("ARCH_NAME")'
$ !
$! APACHE$ROOT:[CGI-BIN]GETPDF.COM
$ REPORT = "WEBREPORT$STORE:AWPFWDRP3_20050823_1686.PDF"
$ APACHE$FLIP_CCL
$ WRITE SYS$OUTPUT F$FAO("!AS!/!/","Content-Type: application/pdf")
$ APACHE$DCL_BIN 'REPORT'
$!
FLIP_CCL changes the output (SYS$OUTPUT) so that CRLF isn't sent, and DCL_BIN enables you to output binary files in chunks.
All this is of course, very badly documented by Apache!
Rob.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2005 02:29 AM
тАО08-31-2005 02:29 AM
Re: Apache Content-Type for PDF
I did some testing. As I have no Apache installed I just write a simple TCPIP service:
$ open/read/write x sys$net
$ write x F$FAO("!AS!/","HTTP/1.0 200 OK")
$ write x F$FAO("!AS!/","Content-type: application/pdf")
$ write x F$FAO("!/")
$ define sys$output x/nolog
$ type sys$login:h.pdf
$ close x
First tests was not succesful. Acrobat complains on the file.
I save the file on the disk and see that the CR/LF pairs were replaced to one CR. So I did SET FILE/ATTR=(RFM=FIX,LRL=512,MRS=512) on the pdf file. Now works all fine.
Bojan