in reply to CGI download filename weirdness

What is in $pdffile? What is in $pdfid? Are they supposed to be different? According to the documentation, specifically Creating a Standard HTTP Header, the suggested name is specified with the -attachment parameter.

Replies are listed 'Best First'.
Re^2: CGI download filename weirdness
by Anonymous Monk on Feb 08, 2010 at 17:18 UTC
    Thanks for the response. $pdffile is a path to the "physical" file, and $pdfid is the name of that file, without the extension.

    I just tried pulling out this code into a separate script and giving these variables hard-coded values, and it works fine there, so it seems to be caused by something elsewhere than in the snippet I posted. This little PDF subroutine is part of a monstrous pile of code, thousands of lines long, and a real nightmare to debug.

    A perhaps related issue is that on some browsers, the download never quite gets wrapped up properly - it gets left with a ".part" extension which needs to be removed manually in order to use an otherwise fine file.

    Still digging away at this...

      I was trying to imply that $pdfid does not contain what you think it does. You should be able to do a simple file search for $pdfid to see where it was last modified. I highly doubt this is a browser issue.

        Well, replacing these variables with hard-coded values produces exactly the same effect, so that rules that one out. It seems the problem is definitely elsewhere in this pile'o'code. Thanks for the thoughts anyway.