Also, I am unable to fetch photos when using .xlsx
but when i use .xls file i can fetch photos from Excel file using following code:
//------ Following is used to fetch and save images $count = 1; foreach ($objPHPExcel->getSheetByName("Photographs")->getDrawingCollection() as $drawing) { if ($drawing instanceof PHPExcel_Worksheet_MemoryDrawing) { ob_start(); call_user_func( $drawing->getRenderingFunction(), $drawing->getImageResource() ); $imageContents = ob_get_contents(); //Save graph image $fp = @fopen("picture".$count.".png" , "w"); @fwrite($fp , $imageContents); @fclose($fp); ob_end_clean(); $count++; } }
do you know how we can fetch other objects from XLS like 'MS Word' ?