R
rsgalloway
I'm trying to save an image from a Flash AS3 to my server as a jpg
file. I found some PHP code to do this, but I want to do this in
Python. I'm not quite sure how to convert the following code to
Python. It's mainly the $GLOBALS["HTTP_RAW_POST_DATA"] part I don't
know how to convert.
<?php
if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {
// get bytearray
$im = $GLOBALS["HTTP_RAW_POST_DATA"];
// save image
$f = fopen($_GET['name'], 'wb');
fwrite($f, $jpg);
fclose($f);
} else echo 'An error occured.';
?>
source:
http://designreviver.com/tutorials/actionscript-3-jpeg-encoder-revealed-saving-images-from-flash/
file. I found some PHP code to do this, but I want to do this in
Python. I'm not quite sure how to convert the following code to
Python. It's mainly the $GLOBALS["HTTP_RAW_POST_DATA"] part I don't
know how to convert.
<?php
if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {
// get bytearray
$im = $GLOBALS["HTTP_RAW_POST_DATA"];
// save image
$f = fopen($_GET['name'], 'wb');
fwrite($f, $jpg);
fclose($f);
} else echo 'An error occured.';
?>
source:
http://designreviver.com/tutorials/actionscript-3-jpeg-encoder-revealed-saving-images-from-flash/