Click to See Complete Forum and Search --> : PHP to ASP


careyr69
07-23-2007, 03:08 PM
I need to create an asp page to take binary data and convert a jpeg. I have the code for php and I'm not sure how to get it to work in asp. My hosting company is no longer offering Linux and Coldfusion. I use Coldfusion for all my Flash Remoting stuff. Flash is actually sending the binary image data.

PHP Code:

<?php

if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {

// get the binary stream
$im = $GLOBALS["HTTP_RAW_POST_DATA"];

// write is as 'wb'
$fp = fopen($_GET['name'], 'wb');

fwrite($fp, $im);
fclose($fp);

echo "result=".$_GET['name'];

} else echo 'result=An error occured.';

?>



Tried ASP code:

<%
Dim gv_GLOBALS(), gv_fp, gv_im


If isset ( gv_GLOBALS("HTTP_RAW_POST_DATA") ) then
' get the binary stream
$im = $GLOBALS["HTTP_RAW_POST_DATA"]
' write is as 'wb'
$fp = fopen($_GET["name"], "wb")
fwrite(gv_fp, gv_im);
fclose(gv_fp);
Response.Write "result=" & $_GET["name"]
End If

else Response.Write "result=An error occured."

%>

Any Ideas?

Thanks

careyr69
07-24-2007, 09:07 AM
I believe it's just a raw binary POST of data. Does anyone know how to do this or where I can find out how?

Thanks