serving and downloading pdf's OT?

J

Jeff Thies

I have a series of pdf's I'd like to control download access to on an
individual basis.

I thought: I'll read the file server side, print the Content-type:
application/pdf and then the pdf file. Trouble with this is the filename is
lost when you try to save it. Is there a way to suggest the 'Save as" file
name?

Only thing else I can think of is to create a special htaccess controlled
directory for each downloader or file and create symbolic links to them.

Ideas???

Jeff
 
T

Toby A Inkster

Jeff said:
I thought: I'll read the file server side, print the Content-type:
application/pdf and then the pdf file. Trouble with this is the filename is
lost when you try to save it. Is there a way to suggest the 'Save as" file
name?

You could try the following HTTP header:

Content-Disposition: inline; filename=myfile.pdf
 
J

Jeff Thies

I thought: I'll read the file server side, print the Content-type:
You could try the following HTTP header:

Content-Disposition: inline; filename=myfile.pdf

Thanks that works fine for save as.

I'm having trouble providing a link that also opens. The header variations
I've tried so far cause an acrobat crash on opening. Either Content-type:
application/pdf or Content-disposition: inline followed by a blank line and
then the pdf.

Can you give a complete header? Or a resource? Google yields many results,
none helpfull.

Cheers,
Jeff
 
T

Toby A Inkster

Jeff said:
I'm having trouble providing a link that also opens. The header variations
I've tried so far cause an acrobat crash on opening. Either Content-type:
application/pdf or Content-disposition: inline followed by a blank line and
then the pdf.

You want both the Content-Disposition *and* the Content-Type. If you don't
send a Content-Type you will have muchos problemos.
 
J

Jeff Thies

I'm having trouble providing a link that also opens. The header
variations
You want both the Content-Disposition *and* the Content-Type. If you don't
send a Content-Type you will have muchos problemos.

Hmm, seems to be a problem with IE5 for me. NS7.1 and Opera 7 get it right.

Maybe it's just my browser although it reads normally linked pdfs

Here's exactly as I have it:

print "Content-Disposition: inline; filename=$id\.pdf
Content-type: application/pdf

";
print $pdf;

Thanks,
Jeff
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top