PDA

View Full Version : Best Practice - saving multiple images


calipoop
04-14-2011, 09:18 PM
I'm building a Flash application that spits out 6 jpg byte arrays using Adobe's JPEGEncoder. Typically, with just 1 jpg I'd use something like the following simple php:


$fp = fopen("images/image.jpg", 'wb') or die("fail");
fwrite($fp, $GLOBALS['HTTP_RAW_POST_DATA']);
fclose($fp);


With 6 jpgs should I just call the php file six times? Or is there a slicker way to handle all 6 with one call?

I must admit I'm still a php novice, but I'd guess that if the php is being sent multiple jpg streams, a different method of retrieving each stream would need to be used - instead of HTTP_RAW_POST_DATA. I've tried that in the past, and found that moving away from HTTP_RAW_POST_DATA conflicts with the actionscript portion:

request.contentType = "application/octet-stream";



Thanks forum members/moderators for all your help these past years!