Jump to content

Having PHP tell my AlivePDF to.... Save to my webspace?


TRemmie

Recommended Posts

I am a huge PHP newbie, so I had to come ask some questions. I am currently using AlivePDF to generate PDFs that a user can come customize with their info, pic, etc...

 

The final steps in the Actionscript code calls a basic PHP script that I believe leads to Save as dialog box. Is it possible to have it... Save to my website instead of letting the user save it themselves?

 

 

Here is the code it uses.

<?php

$method = $_GET['method'];
$name = $_GET['name'];

if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {

// get bytearray
$pdf = $GLOBALS["HTTP_RAW_POST_DATA"];

// add headers for download dialog-box
header('Content-Type: application/pdf');
header('Content-Length: '.strlen($pdf));
header('Content-disposition:'.$method.'; filename="'.$name.'"');
echo $pdf;

}  else echo 'An error occured.';

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.