save to server
Posted: Tue Jun 23, 2009 9:07 pm
PHP Newbie here,
I have a flex app that iam using alivepdf to create a pdf document the current code below allows the user to download the pdf file, i would also like to upload the same pdf to the server is this possible?
any help would be appreciated or point me in the right direction
Cheers
B
I have a flex app that iam using alivepdf to create a pdf document the current code below allows the user to download the pdf file, i would also like to upload the same pdf to the server is this possible?
any help would be appreciated or point me in the right direction
Cheers
B
Code: Select all
<?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.';
?>