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.';

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.