You are here: Re: sending JPG bytes to a PHP script via POST? « PHP Programming Language « IT news, forums, messages
Re: sending JPG bytes to a PHP script via POST?

Posted by Jerry Stuckle on 11/13/07 02:35

joshuajnoble wrote:
> On Nov 12, 10:05 pm, Darko <darko.maksimo...@gmail.com> wrote:
>> 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
>
>
>
> The image is generated in the Flash Player and then sent to the
> script. There must be something wrong with the data then because all
> that I see returned in the browser when I tried to do that earlier I
> saw:
>
> ÿØÿÃ
>
> So...not quite what I was hoping for :)
>

(Top posting fixed)

How are you trying to generate the image? Some code would help...

P.S. Please don't top post. Thanks.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация