HTTP_RAW_POST_DATA questions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
RustyDoorknobs
Forum Newbie
Posts: 15
Joined: Mon Sep 07, 2009 4:50 pm

HTTP_RAW_POST_DATA questions

Post 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?
thinsoldier
Forum Contributor
Posts: 367
Joined: Fri Jul 20, 2007 11:29 am
Contact:

Re: HTTP_RAW_POST_DATA questions

Post 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".
Warning: I have no idea what I'm talking about.
Post Reply