Hi: 

This is *not* really a python problem, but :-) since this
is such an helpful list and others may have the same issue...

I have a python script which searches a server for a pdf file
and if found, reads the file to stdout, as one would read html
to stdout.

The question is really about the proper content-type:

Both of the following functions have been tried:

def pdf_header1(file_name,length):
    """ Serve a PDF document via CGI with content length."""
    print (
        'Content-type: application/pdf\n'
        'Content-Length: %d\n'
        'Content-Disposition: attachment;filename="%s"\n'
        ) % (length,file_name)

def pdf_header(file_name,length):
    """ Serve a PDF document via CGI with content length."""
    print (
        'Content-type: application/pdf\n'
        'Content-Disposition: inline; filename=%s\n'
        'Content-length: %d\n'
        ) % (file_name,length)

Regardless of which is used, on Mozilla, I have the following
response: 
  A dialog that names the file, identifies the filetype, and
  gives a choice of whether to download or open the file.
  when the choice is made, progress is reported via another
  window and the selected action occurs when download is finished.

On Internet Explorer 6, Windows XP, the user experience is different.
IE ignores the file name, and does no progress reporting, but does
"understand" the file type.

Does anyone have any experience with this issue? Or could anyone
recommend a more appropriate place to post this question?
Thanks
tim

-- 
Tim Johnson <[EMAIL PROTECTED]>
      http://www.alaska-internet-solutions.com
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to