|
Posted by Darko on 11/13/07 01:05
On Nov 13, 1:59 am, joshuajnoble <joshuajno...@gmail.com> wrote:
> Hi all, I'm working with a flash application that sends a small JPEG
> as binary data over a post to a PHP script. I'd like the script to be
> able to display that JPEG but I've tried imagecreatefromstring without
> any luck and looked through the documentation without much luck. The
> data getting sent to the PHP script is a valid JPEG file, but I'm not
> sure what to do with it once it gets there. Is there a way to do this,
> or is there a better way to do it, or is this not possible? Thanks for
> any advice or hints.
Are you sure you have post the question right? Because this way it
looks as if
you have the picture on the client, then you send it to server, and
then you
expect the script to return an image in response? All that by POST
method?
Where do you get that image from on the client?
Never mind. If you want to display an image from PHP, you do something
like this:
<?php
header( "Content-Type: image/jpeg" ); // jpeg in your case
$imageData = ...; // you get this data somehow, from POST or
whatever you imagine it like
echo $imageData;
?>
That is it. The key is in header function, i.e. in Content-Type.
Regards
Navigation:
[Reply to this message]
|