- <?php
- class JPEGEncoder
- {
- function JPEGEncoder ( )
- {
- }
- /**
- @desc save the JPEG on server
- */
- function saveToServer ( $pInfos )
- {
- $bytearray = $pInfos["jpegstream"];
- // bytearray is in the ->data property
- $imageData = $bytearray->data;
- $idimage = $pInfos["fileName"];
- return ( $success = file_put_contents("../../../".$idimage, $imageData) ) ? $idimage : $success;
- }
- }
- ?>