#1 Define save type

closed
None
5
2001-09-25
2001-09-11
Henrik Hansen
No

A paremeter, a function, a whatever to define if you
want to save the file to your harddrive or you want to
get a dialog (open or save to disk). The only possible
way now is the dialog (as far as i can see).

Discussion

    • assigned_to: nobody --> eru
     
    • priority: 5 --> 3
     
  • Logged In: YES
    user_id=112842

    This is a tricky thing, as this is mostly a browser thing. Each
    browser has a different handling with forcing "download". I
    tried it with the Explorer lately and failed to accomplish a
    download when creating a PDF. Maybe you could help and
    tell me how to accomplish this?

     
  • Henrik Hansen
    Henrik Hansen
    2001-09-17

    Logged In: YES
    user_id=242058

    internet explorer 5.x are very picky with it's headers, but
    the below headers are know to work because I use them to to
    the same as we want here.

    header("Content-Type: application/pdf; name=filename.pdf");
    header("Content-Length: " . strlen($content));
    header("Content-Disposition: atachment;
    filename=filename.pdf");

    echo $content;

    this will bring up the dialog box weather you want to open
    or download.

     
  • Logged In: YES
    user_id=112842

    I made a change in pc4_main (on my development-server):

    header( "Content-Type: application/pdf; name=acrobat.pdf" );
    header( "Content-Disposition: attachement;
    filename=acrobat.pdf" );
    header( "Content-Length: ".strlen( $pdfdata ) );
    and as I was afraid, this is not working, neither with
    attachement (which should be the correct spelling) nor with
    atachement ;-)

    Once again, if you can provide me with the correct mimetypes
    for Explorer and Netscape I'm very happy to implement them.
    IIrc it is sufficient to give an application/download to the
    Netscape/Mozilla, isn't it?

     
  • Henrik Hansen
    Henrik Hansen
    2001-09-17

    Logged In: YES
    user_id=242058

    Try to put them in the same order at I did in my example.
    maybe you can paste the whole diff you made?

     
  • Logged In: YES
    user_id=112842

    Obviously the order is important *sigh* Damn IE!
    Anyway, I implemented pc4p_set_savepdf in pc4p_main,
    please try and use it. I tested with Mozilla 0.94 and IE
    6.0, everything worked fine.

     
  • Henrik Hansen
    Henrik Hansen
    2001-09-19

    Logged In: YES
    user_id=242058

    yeah i had many problems getting this to work too :) I will
    test it when i get some time:)

     
  • Henrik Hansen
    Henrik Hansen
    2001-09-19

    Logged In: YES
    user_id=242058

    As far as i could see from your diff i can only save a pdf
    with either inline or attachment headers, what about a
    function just to fwrite the pdf to your harddisk ? (to
    avoid headers() in your script).

     
  • Logged In: YES
    user_id=112842

    Doh, that also? :-) Oookey, back coding...

     
  • Henrik Hansen
    Henrik Hansen
    2001-09-19

    Logged In: YES
    user_id=242058

    yes please... :) cool ;)

     
  • Logged In: YES
    user_id=112842

    Please be so kind and update your files, I made some
    changes...have fun - next changes not before tomorrow ;-)
    G'Night

     
    • priority: 3 --> 5
    • status: open --> closed