How to give (put to browser) someone PDF document, with hidden path to document.

M

MAX

How to give (put to browser) someone PDF document, with hidden path to
document.
If I use locate, user can see exact location of PDF document.
Perl script work on Microsoft IIS server and that cud be problem if I wont
to use password on folder.

#!/usr/bin/perl
#
#
# print "Content-type: text/html\n\n";
$line="www.mladilist.com/down/a.pdf";
print "Location: http://$line\n\n";
# ---------------------------------------

Is it possible to hide document(directory) with password, so that you can
read it only from perl script.
Tnx.

Paul
 
I

Ian Wilson

MAX said:
How to give (put to browser) someone PDF document, with hidden path to
document.

I'd have a CGI script, at an innocuous URL, read the file from the
hidden path and print it to STDOUT after emitting the appropriate HTTP
headers (e.g. 'Content-type: text/pdf' or whatever.) I recall there are
modules that can assist with this.
If I use locate, user can see exact location of PDF document.

Then I wouldn't if that is really important. I don't see why it could be
important.
Perl script work on Microsoft IIS server and that cud be problem if I wont
to use password on folder.

I think passwording folders would be best handled as an IIS problem not
a Perl problem. I'd ask in an IIS newsgroup.
#!/usr/bin/perl
IIS?

#
#
# print "Content-type: text/html\n\n";
$line="www.mladilist.com/down/a.pdf";

I'd use single quotes, include the 'http://' and name the variable $url.

I assume $line is also used elsewhere?
# ---------------------------------------

Have you read the posting guidelines? use strict; use warnings; etc
Is it possible to hide document(directory) with password, so that you can
read it only from perl script.

Yes but that would be an IIS problem not a Perl problem. I'd ask in an
IIS newsgroup.
 
T

Tad McClellan

MAX said:
How to give (put to browser) someone PDF document, with hidden path to
document.


print() the appropriate headers to STDOUT
open() the file
binmode() the input and output filehandles
readline() from the file and print() to STDOUT
close() the file

Perl script work on Microsoft IIS server and that cud be problem if I wont
to use password on folder.


If you tell us how that is a problem, then we might be able
to help you solve it...
 
L

Larry

Tad said:
print() the appropriate headers to STDOUT
open() the file
binmode() the input and output filehandles
readline() from the file and print() to STDOUT
close() the file

I would not recommend readline on a binary file. Use "read".
 
A

axel

Tad McClellan said:
print() the appropriate headers to STDOUT
open() the file
binmode() the input and output filehandles
readline() from the file and print() to STDOUT
close() the file

I have never worked out how to pass the correct name of the file
rather than the file being downloaded with the name of foo.pl
but that is not a Perl question.

Axel
 
R

Robert Sedlacek

(e-mail address removed) wrote
I have never worked out how to pass the correct name of the file
rather than the file being downloaded with the name of foo.pl
but that is not a Perl question.

OT, but I think it was a Content-Disposition header like:
Content-Disposition: attachment; filename=world-takeover.pdf

hth, p
 
A

A. Sinan Unur

(e-mail address removed) wrote in
I have never worked out how to pass the correct name of the file
rather than the file being downloaded with the name of foo.pl
but that is not a Perl question.

I have not worked it out either, but

<URL:http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1>

See also:

<URL:http://support.microsoft.com/kb/q279667/>

<URL:http://support.microsoft.com/kb/q260519/>

Hope this gives you a head start. I am sure someone over at
comp.infosystems.www.authoring.cgi will have answers if you run into
difficulties.

Sinan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top