When taking online flash photos, we need to save the data from flashHTTP_RAW_POST_DATA. We can save the image data sent from flash. Let's take a look at the source code. When taking online flash photos, we need to save the data from flash HTTP_RAW_POST_DATA. We can save the image data sent from flash. Let's take a look at the source code.
Script ec (2); script
@ Session_start ();
Require_once ("../Inc/Conn. php ");
Require_once ("../Inc/function. php ");
$ Filepath = '../userhead /';
$ Filename = time (). mt_rand (10,100 );
// $ Uid = get_id ($ _ SESSION ['uname']);
$ Uid = 14;
If (isset ($ GLOBALS ["HTTP_RAW_POST_DATA"])
{
$ Im = $ GLOBALS ["HTTP_RAW_POST_DATA"];
If (! Is_dir ($ filepath ))
{
Mkdir ($ filepath, 0777 );
}
If(file_put_contents({filepath.20.filename.'.jpg ', $ im ))
{
$ Path = 'HTTP: // '. $ _ SERVER ['HTTP _ host'].'/userhead/'.w.filename.'.jpg ';
SavaPath ($ path );
}
Else
{
ShowMsg ('result: false ');
}
}
Function savaPath ($ path)
{
Global $ uid;
$ SQL = "Insert into dd (oy_uid, oy_dsp, oy_path) value ('$ uid','',' $ path ')";
If (mysql_query ($ SQL ))
{
ShowMsg ('result: true ');
}
Else
{
ShowMsg ('result: false'. mysql_error ());
}
}
?>
Original Site reprint notes: www.111cn.net/phper/php.html