If you have access to the Apache httpd.conf file, then define an alias to your PDF directory, e.g.
Alias /pdf/ /view/dvsview/vops/ps/projects/
You will then be able to link to http://yoursite/pdf/xx.pdf

If this is not possible, then try writing a 'wrapper' along the lines of

#! /usr/bin/perl -w use strict; use CGI qw(:standard); my $basedir = "/view/dvsview/vobs/ps/projects/"; my $file = param('file'); open PDF,"<$basedir$file" or die("Cannot open $file: $!"); print "Content-type: application/pdf\n\n"; print while (<PDF>);
Save this as 'view.pl', then link to http://yoursite/cgi-bin/view.pl?file=xx.pdf

If you use this method then I would strongly suggest putting some better error checking in the code (you will get a server error if the open fails).

Hope this puts you on the right track,

JJ


In reply to Re: pdf file display by jj808
in thread pdf file display by jyothi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.