AlivePDF download and save to server
URL: http://blog.vamapaull.com/alivepdf-download-and-save-to-server/
This PHP code is made to help people using the ActionScript 3 AlivePDF library to save PDF files from a Flash app to a server.
ActionScript 3 AlivePDF save code:
_pdf.save(Method.REMOTE, "save.php", Download.ATTACHMENT, "MyFile.pdf");
Copy this code and paste it in your HTML
<?php
//This project is done by vamapaull: http://vamapaull.com
if(isset($GLOBALS["HTTP_RAW_POST_DATA"])){ $pdf = $GLOBALS["HTTP_RAW_POST_DATA"];
$name = $_GET["name"];
$save_to = "pdf/". $name;
file_put_contents($save_to, $pdf);
// add headers for download dialog-box
header('Content-Type: application/pdf');
header('Content-disposition:'.$method.'; filename="'.$name.'"');
} else{
echo "Encoded PDF information not received.";
}
?>
Report this snippet