Page 1 of 1

HTTP_RAW_POST_DATA questions

Posted: Fri Jan 15, 2010 4:18 pm
by RustyDoorknobs
Hey,
I am saving an image from a flash application I have created,
It works but I want to be able to draw an image and embed it in my html file:

Code: Select all

 
if (isset($GLOBALS["HTTP_RAW_POST_DATA"]))
{
    // get bytearray
    $jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
 
    // add headers for download dialog-box
    header('Content-Type: image/jpeg');
    header("Content-Disposition: attachment; filename=".$_GET['name']);
    echo $jpg;
}
 
Can I use like the gd library or something so I can embed it like: <img src="asjhlfd" />

And then put a button to download it?

Re: HTTP_RAW_POST_DATA questions

Posted: Fri Jan 15, 2010 5:18 pm
by thinsoldier
No, idea, but here's what I found on php.net

To get the Raw Post Data:

<?php $postdata = file_get_contents("php://input"); ?>

Please see the notes here:
http://us.php.net/manual/en/wrappers.php.php


http://us.php.net/manual/en/wrappers.php.php
php://input allows you to read raw POST data. It is a less memory intensive alternative to $HTTP_RAW_POST_DATA and does not need any special php.ini directives. php://input is not available with enctype="multipart/form-data".