in reply to PDF file opening from Linux but not opening from Windows

Not entirely sure I correctly understand what you're trying to do, but is there any reason to use the MIME-type "application/octet-stream"? In case you're trying to deliver PDF content, the MIME-type "application/pdf" would be more appropriate, I think... (also see this FAQ)

On Windows, can you do "save link as..." or some such (i.e. save to disk), and then properly view the resulting file? If not, you might want to compare the contents of this file with the contents of your original /tmp/... file.

There are a number of factors that could account for the differences in behaviour between Linux and Windows... So, some more info would be helpful if you need further comments -- e.g. which browser, PDF reader/plugin, MIME-type associations configured, etc.

  • Comment on Re: PDF file opening from Linux but not opening from Windows

Replies are listed 'Best First'.
Re^2: PDF file opening from Linux but not opening from Windows
by pankaj_it09 (Scribe) on Nov 27, 2006 at 09:07 UTC
    I got the solution.

    I did this -->
    print $query->header(-type=> "application/octet-stream",-attachment=>"$oldfile",-Content_Length => $size);

    I added the -Content_Length of the file . After that the pdf files started opening.
Re^2: PDF file opening from Linux but not opening from Windows
by Anonymous Monk on Nov 25, 2006 at 05:54 UTC
    Even if I use the MIME type "application/pdf" the problem remains the same.
    Moreover I have to open other types of files like excel etc. The excel files are opening nicely.
    Only problem is with PDF files .
    I tried saving the file also still the same error.
    On IE and mozilla I have tested it the same result.
    The PDF software is working nicely with the local files.
Re^2: PDF file opening from Linux but not opening from Windows
by pankaj_it09 (Scribe) on Nov 25, 2006 at 05:57 UTC
    Even if I use the MIME type "application/pdf" the problem remains the same.
    Moreover I have to open other types of files like excel etc. The excel files are opening nicely.
    Only problem is with PDF files .
    I tried saving the file also still the same error.
    On IE and mozilla I have tested it the same result.
    The PDF software is working nicely with the local files.